Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aassign of repeated constant to hash gives odd return #6886

Closed
p5pRT opened this issue Oct 31, 2003 · 3 comments
Closed

aassign of repeated constant to hash gives odd return #6886

p5pRT opened this issue Oct 31, 2003 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Oct 31, 2003

Migrated from rt.perl.org#24380 (status was 'resolved')

Searchable as RT24380$

@p5pRT
Copy link
Author

p5pRT commented Oct 31, 2003

From @ysth

Created by sthoenna@dhx98431.nonet

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.

Perl Info

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)

@p5pRT
Copy link
Author

p5pRT commented Nov 13, 2003

From @rgs

Yitzchak Scott-Thoennes (via RT) wrote​:

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.

This should be fixed by​:

Change 21714 by rgs@​rgs-home on 2003/11/13 18​:55​:37

  Fix bug [perl #24380] : assigning to a hash in list
  or scalar context yielded a wrong value if the list
  contained duplicated keys for the hash. This is fixed
  by counting the number of duplicate keys and trimming
  the stack by the corresponding number of items.

Affected files ...

... //depot/perl/pp_hot.c#334 edit
... //depot/perl/t/op/hashassign.t#2 edit

@p5pRT p5pRT closed this as completed Nov 13, 2003
@p5pRT
Copy link
Author

p5pRT commented Nov 13, 2003

@rgs - Status changed from 'new' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant