develooper Front page | perl.perl5.porters | Postings from November 2003

[perl #24380] aassign of repeated constant to hash gives odd return

Thread Next
From:
Yitzchak Scott-Thoennes
Date:
November 1, 2003 08:27
Subject:
[perl #24380] aassign of repeated constant to hash gives odd return
Message ID:
rt-24380-66876.3.69665629728466@rt.perl.org
# New Ticket Created by  Yitzchak Scott-Thoennes 
# Please include the string:  [perl #24380]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt2/Ticket/Display.html?id=24380 >


This is a bug report for perl from sthoenna@dhx98431.nonet,
generated with the help of perlbug 1.34 running under perl v5.8.2.


-----------------------------------------------------------------
[Please enter your report here]

aassign to a hash has some problems in list context:

$ perl5.8.2 -wle'our %x; print join ":",%x=(1)x8'
Use of uninitialized value in join or string at -e line 1.
1::1:1:1:Use of uninitialized value in join or string at -e line 1.
:1:1
$ perl5.8.2 -wle'print [%x=(1)x8]'
Name "main::x" used only once: possible typo at -e line 1.
Bizarre copy of ARRAY in anonlist at -e line 1.
$ perl5.8.2 -wle'use Devel::Peek; Dump $_ for %x=(1)x8'
Name "main::x" used only once: possible typo at -e line 1.
SV = PVIV(0x10272038) at 0x1028608c
  REFCNT = 2
  FLAGS = (IOK,POK,READONLY,pIOK,pPOK)
  IV = 1
  PV = 0x10272898 "1"\0
  CUR = 1
  LEN = 2
SV = NULL(0x0) at 0x10271170
  REFCNT = 2
  FLAGS = ()
SV = PVIV(0x10272038) at 0x1028608c
  REFCNT = 2
  FLAGS = (IOK,POK,READONLY,pIOK,pPOK)
  IV = 1
  PV = 0x10272898 "1"\0
  CUR = 1
  LEN = 2
SV = PVIV(0x10272050) at 0x10271284
  REFCNT = 2
  FLAGS = (IOK,POK,pIOK,pPOK)
  IV = 1
  PV = 0x10272d98 "1"\0
  CUR = 1
  LEN = 2
SV = PVIV(0x10272038) at 0x1028608c
  REFCNT = 2
  FLAGS = (IOK,POK,READONLY,pIOK,pPOK)
  IV = 1
  PV = 0x10272898 "1"\0
  CUR = 1
  LEN = 2
SV = NULL(0x0) at 0x10271170
  REFCNT = 2
  FLAGS = ()
SV = PVIV(0x10272038) at 0x1028608c
  REFCNT = 2
  FLAGS = (IOK,POK,READONLY,pIOK,pPOK)
  IV = 1
  PV = 0x10272898 "1"\0
  CUR = 1
  LEN = 2
SV = PVIV(0x10272050) at 0x10271284
  REFCNT = 2
  FLAGS = (IOK,POK,pIOK,pPOK)
  IV = 1
  PV = 0x10272d98 "1"\0
  CUR = 1
  LEN = 2

And the really weird:

$  perl5.8.2 -wle'use Devel::Peek; sub foo { Dump \@_ } foo(%x=(1)x8)'
Name "main::x" used only once: possible typo at -e line 1.
SV = RV(0x10291020) at 0x10271170
  REFCNT = 1
  FLAGS = (TEMP,ROK)
  RV = 0x10286050
  SV = PVAV(0x10273750) at 0x10286050
    REFCNT = 3
    FLAGS = ()
    IV = 0
    NV = 0
    ARRAY = 0x1028e448
    FILL = 7
    MAX = 7
    ARYLEN = 0x0
    FLAGS = (REAL)
    Elt No. 0
    SV = PVIV(0x10272038) at 0x1029b0d4
      REFCNT = 5
      FLAGS = (IOK,POK,READONLY,pIOK,pPOK)
      IV = 1
      PV = 0x10272898 "1"\0
      CUR = 1
      LEN = 2
    Elt No. 1
    SV = RV(0x10291020) at 0x10271170
      REFCNT = 1
      FLAGS = (TEMP,ROK)
      RV = 0x10286050
      SV = PVAV(0x10273750) at 0x10286050
        REFCNT = 3
        FLAGS = ()
        IV = 0
        NV = 0
        ARRAY = 0x1028e448
        FILL = 7
        MAX = 7
        ARYLEN = 0x0
        FLAGS = (REAL)
        Elt No. 0
        SV = PVIV(0x10272038) at 0x1029b0d4
          REFCNT = 5
          FLAGS = (IOK,POK,READONLY,pIOK,pPOK)
          IV = 1
          PV = 0x10272898 "1"\0
          CUR = 1
          LEN = 2
        Elt No. 1
        SV = RV(0x10291020) at 0x10271170
          REFCNT = 1
          FLAGS = (TEMP,ROK)
          RV = 0x10286050
        Elt No. 2
        SV = PVIV(0x10272038) at 0x1029b0d4
          REFCNT = 5
          FLAGS = (IOK,POK,READONLY,pIOK,pPOK)
          IV = 1
          PV = 0x10272898 "1"\0
          CUR = 1
          LEN = 2
        Elt No. 3
        SV = PVIV(0x10272050) at 0x10271284
          REFCNT = 3
          FLAGS = (IOK,POK,pIOK,pPOK)
          IV = 1
          PV = 0x10272d98 "1"\0
          CUR = 1
          LEN = 2
    Elt No. 2
    SV = PVIV(0x10272038) at 0x1029b0d4
      REFCNT = 5
      FLAGS = (IOK,POK,READONLY,pIOK,pPOK)
      IV = 1
      PV = 0x10272898 "1"\0
      CUR = 1
      LEN = 2
    Elt No. 3
    SV = PVIV(0x10272050) at 0x10271284
      REFCNT = 3
      FLAGS = (IOK,POK,pIOK,pPOK)
      IV = 1
      PV = 0x10272d98 "1"\0
      CUR = 1
      LEN = 2
Attempt to free unreferenced scalar: SV 0x10271170.
Attempt to free unreferenced scalar: SV 0x10271170.

[Please do not change anything below this line]
-----------------------------------------------------------------
---
Flags:
    category=core
    severity=low
---
Site configuration information for perl v5.8.2:

Configured by sthoenna at Thu Oct 30 14:06:28 PST 2003.

Summary of my perl5 (revision 5.0 version 8 subversion 2 patch 21574) configuration:
  Platform:
    osname=cygwin, osvers=1.5.5(0.9432), archname=cygwin-multi-64int
    uname='cygwin_nt-5.1 dhx98431 1.5.5(0.9432) 2003-09-20 16:31 i686 unknown unknown cygwin '
    config_args='-de -Dusedevel -Dmksymlinks -Duse64bitint -Dusemultiplicity -Doptimize=-g -Dman3ext=3pm'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=define
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=define use64bitall=undef uselongdouble=undef
    usemymalloc=y, bincompat5005=undef
  Compiler:
    cc='gcc', ccflags ='-DPERL_USE_SAFE_PUTENV -DDEBUGGING -fno-strict-aliasing',
    optimize='-g',
    cppflags='-DPERL_USE_SAFE_PUTENV -DDEBUGGING -fno-strict-aliasing'
    ccversion='', gccversion='3.3.1 (cygming special)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=12345678
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
    ivtype='long long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='ld2', ldflags =' -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib /lib
    libs=-lgdbm -ldb -lcrypt -lutil -lgdbm_compat
    perllibs=-lcrypt -lutil -lgdbm_compat
    libc=/usr/lib/libc.a, so=dll, useshrplib=true, libperl=libperl.a
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -L/usr/local/lib'

Locally applied patches:
    MAINT21558

---
@INC for perl v5.8.2:
    /usr/local/lib/perl5/5.8.2/cygwin-multi-64int
    /usr/local/lib/perl5/5.8.2
    /usr/local/lib/perl5/site_perl/5.8.2/cygwin-multi-64int
    /usr/local/lib/perl5/site_perl/5.8.2
    /usr/local/lib/perl5/site_perl
    .

---
Environment for perl v5.8.2:
    CYGWIN=tty ntsec title
    HOME=/home/sthoenna
    LANG (unset)
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PATH=/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/bin:/cygdrive/c/WINDOWS/system32:/cygdrive/c/WINDOWS:/cygdrive/c/WINDOWS/System32/Wbem:/cygdrive/c/Program Files/Common Files/Adaptec Shared/System:/cygdrive/c/Program Files/Rational/common
    PERL_BADLANG (unset)
    SHELL (unset)


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About