develooper Front page | perl.perl5.porters | Postings from January 2014

[perl #120939] [PATCH] refactor and fix leak in const_av_xsub

Thread Previous
From:
bulk88
Date:
January 6, 2014 03:35
Subject:
[perl #120939] [PATCH] refactor and fix leak in const_av_xsub
Message ID:
rt-4.0.18-3644-1388979347-1643.120939-75-0@perl.org
# New Ticket Created by  bulk88 
# Please include the string:  [perl #120939]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=120939 >


This is a bug report for perl from bulk88@hotmail.com,
generated with the help of perlbug 1.39 running under perl 5.19.7.


-----------------------------------------------------------------
[Please describe your issue here]

This patch might need more refinement, specifically I think the number 
of asserts is excessive, I used them when I developed the patch and was 
having "Bizarre copy of" problems, but I think they are useless now. The 
function dropped from 0x122 bytes of machine code to 0x10c on my VC 2003 
32 bits -O1 build. The TARG usage "bloated" the function a little bit 
since sv_2mortal(newSViv()) takes less machine code. It is an acceptable 
tradeoff AFAIK.

This ML thread also covers this patch 
http://www.nntp.perl.org/group/perl.perl5.porters/2014/01/msg211182.html 
. The G_SCALAR branch is never executed by a make test. FC's code in the 
ML thread did go through the G_SCALAR branch, but I don't know enough to 
write a test. ../cpan/NEXT/t/stringify.t and op/gv.t execute the G_ARRAY 
branch of this xsub.
------------------------------------
      assert(av);
  #ifndef DEBUGGING
      if (!av) {
-	XSRETURN(0);
+	goto end;
      }
  #endif
------------------------------------
I didn't consider the properness of the above code it came from 
http://perl5.git.perl.org/perl.git/commit/6f1b3ab07ea077b8191fe508269d778bc64a5f50 
as the entire const_av_xsub function.

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

Configured by Owner at Thu Nov 28 02:32:44 2013.

Summary of my perl5 (revision 5 version 19 subversion 7) configuration:
      Derived from: 8f47723e28b75530b743941cdd8b07f849ec48e2
      Ancestor: 1061065f7a09399eefb50e9a035502621722bcc0
      Platform:
        osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
        uname=''
        config_args='undef'
        hint=recommended, useposix=true, d_sigaction=undef
        useithreads=define, usemultiplicity=define
        useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
        use64bitint=undef, use64bitall=undef, uselongdouble=undef
        usemymalloc=n, bincompat5005=undef
      Compiler:
        cc='cl', ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -G7 -GL
-DWIN32 -D_CONSOLE -DNO_STRICT  -DPERL_TEXTMODE_SCRIPTS
-DPERL_HASH_FUNC_ONE_AT_A_TIME -DPERL_IMPLICIT_CONTEXT
-DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T',
        optimize='-O1 -MD -Zi -DNDEBUG -G7 -GL',
        cppflags='-DWIN32'
        ccversion='13.10.6030', gccversion='', gccosandvers=''
        intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
        d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=8
        ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='__int64',
lseeksize=8
        alignbytes=8, prototype=define
      Linker and Libraries:
        ld='link', ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf
-ltcg  -libpath:"c:\perl519\lib\CORE"  -machine:x86'
        libpth="C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\lib"
        libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib
comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib  version.lib
odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
        perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib
winspool.lib  comdlg32.lib advapi32.lib shell32.lib ole32.lib
oleaut32.lib  netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib
version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib
        libc=msvcrt.lib, so=dll, useshrplib=true, libperl=perl519.lib
        gnulibc_version=''
      Dynamic Linking:
        dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
        cccdlflags=' ', lddlflags='-dll -nologo -nodefaultlib -debug
-opt:ref,icf -ltcg  -libpath:"c:\perl519\lib\CORE"  -machine:x86'

Locally applied patches:
        uncommitted-changes
        8f47723e28b75530b743941cdd8b07f849ec48e2

---
@INC for perl 5.19.7:
        C:/perl519/site/lib
        C:/perl519/lib
        .

---
Environment for perl 5.19.7:
        HOME (unset)
        LANG (unset)
        LANGUAGE (unset)
        LD_LIBRARY_PATH (unset)
        LOGDIR (unset)
        PATH=C:\perl519\bin;C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\IDE;C:\Program Files\Microsoft Visual Studio .NET
2003\VC7\BIN;C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Tools;C:\Program Files\Microsoft Visual Studio .NET
2003\Common7\Tools\bin\prerelease;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;
        PERL_BADLANG (unset)
        SHELL (unset)






Thread Previous


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