This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix memory leak in C<sub X { sub {} }> arising from a refcount
[perl5.git] / embed.pl
index 7af1b17..335e9c1 100755 (executable)
--- a/embed.pl
+++ b/embed.pl
@@ -25,6 +25,7 @@ sub walk_table (&@) {
        $F = $filename;
     }
     else {
+       unlink $filename;
        open F, ">$filename" or die "Can't open $filename: $!";
        $F = \*F;
     }
@@ -198,6 +199,7 @@ my @extvars = qw(sv_undef sv_yes sv_no na dowarn
                 diehook
                 dirty
                 perl_destruct_level
+                ppaddr
                 );
 
 sub readsyms (\%$) {
@@ -1592,6 +1594,7 @@ Ap        |char*  |instr          |const char* big|const char* little
 p      |bool   |io_close       |IO* io|bool not_implicit
 p      |OP*    |invert         |OP* cmd
 dp     |bool   |is_gv_magical  |char *name|STRLEN len|U32 flags
+p      |I32    |is_lvalue_sub
 Ap     |bool   |is_uni_alnum   |U32 c
 Ap     |bool   |is_uni_alnumc  |U32 c
 Ap     |bool   |is_uni_idfirst |U32 c
@@ -1626,8 +1629,8 @@ Ap        |bool   |is_uni_xdigit_lc|U32 c
 Ap     |U32    |to_uni_upper_lc|U32 c
 Ap     |U32    |to_uni_title_lc|U32 c
 Ap     |U32    |to_uni_lower_lc|U32 c
-Ap     |int    |is_utf8_char   |U8 *p
-Ap     |bool   |is_utf8_string |U8 *s|STRLEN len
+Apd    |STRLEN |is_utf8_char   |U8 *p
+Apd    |bool   |is_utf8_string |U8 *s|STRLEN len
 Ap     |bool   |is_utf8_alnum  |U8 *p
 Ap     |bool   |is_utf8_alnumc |U8 *p
 Ap     |bool   |is_utf8_idfirst|U8 *p
@@ -1851,9 +1854,9 @@ Apd       |HV*    |get_hv         |const char* name|I32 create
 Apd    |CV*    |get_cv         |const char* name|I32 create
 Ap     |int    |init_i18nl10n  |int printwarn
 Ap     |int    |init_i18nl14n  |int printwarn
-Ap     |void   |new_collate    |const char* newcoll
-Ap     |void   |new_ctype      |const char* newctype
-Ap     |void   |new_numeric    |const char* newcoll
+Ap     |void   |new_collate    |char* newcoll
+Ap     |void   |new_ctype      |char* newctype
+Ap     |void   |new_numeric    |char* newcoll
 Ap     |void   |set_numeric_local
 Ap     |void   |set_numeric_radix
 Ap     |void   |set_numeric_standard
@@ -1932,6 +1935,7 @@ Ap        |SV*    |save_scalar    |GV* gv
 Ap     |void   |save_pptr      |char** pptr
 Ap     |void   |save_vptr      |void* pptr
 Ap     |void   |save_re_context
+Ap     |void   |save_padsv     |PADOFFSET off
 Ap     |void   |save_sptr      |SV** sptr
 Ap     |SV*    |save_svref     |SV** sptr
 Ap     |SV**   |save_threadsv  |PADOFFSET i
@@ -1940,10 +1944,10 @@ p       |OP*    |scalar         |OP* o
 p      |OP*    |scalarkids     |OP* o
 p      |OP*    |scalarseq      |OP* o
 p      |OP*    |scalarvoid     |OP* o
-Ap     |NV     |scan_bin       |char* start|I32 len|I32* retlen
-Ap     |NV     |scan_hex       |char* start|I32 len|I32* retlen
+Ap     |NV     |scan_bin       |char* start|STRLEN len|STRLEN* retlen
+Ap     |NV     |scan_hex       |char* start|STRLEN len|STRLEN* retlen
 Ap     |char*  |scan_num       |char* s|YYSTYPE *lvalp
-Ap     |NV     |scan_oct       |char* start|I32 len|I32* retlen
+Ap     |NV     |scan_oct       |char* start|STRLEN len|STRLEN* retlen
 p      |OP*    |scope          |OP* o
 Ap     |char*  |screaminstr    |SV* bigsv|SV* littlesv|I32 start_shift \
                                |I32 end_shift|I32 *state|I32 last
@@ -2067,15 +2071,17 @@ Ap      |void   |unlock_condpair|void* svv
 Ap     |void   |unsharepvn     |const char* sv|I32 len|U32 hash
 p      |void   |unshare_hek    |HEK* hek
 p      |void   |utilize        |int aver|I32 floor|OP* version|OP* id|OP* arg
-Ap     |U8*    |utf16_to_utf8  |U8* p|U8 *d|I32 bytelen|I32 *newlen
-Ap     |U8*    |utf16_to_utf8_reversed|U8* p|U8 *d|I32 bytelen|I32 *newlen
-Ap     |I32    |utf8_distance  |U8 *a|U8 *b
-Ap     |U8*    |utf8_hop       |U8 *s|I32 off
-ApM    |U8*    |utf8_to_bytes  |U8 *s|STRLEN *len
-ApM    |U8*    |bytes_to_utf8  |U8 *s|STRLEN *len
-Ap     |UV     |utf8_to_uv     |U8 *s|I32* retlen
-Ap     |UV     |utf8_to_uv_chk |U8 *s|I32* retlen|bool checking
-Ap     |U8*    |uv_to_utf8     |U8 *d|UV uv
+ApM    |U8*    |utf16_to_utf8  |U8* p|U8 *d|I32 bytelen|I32 *newlen
+ApM    |U8*    |utf16_to_utf8_reversed|U8* p|U8 *d|I32 bytelen|I32 *newlen
+ApMd   |STRLEN |utf8_length    |U8* s|U8 *e
+ApMd   |IV     |utf8_distance  |U8 *a|U8 *b
+ApMd   |U8*    |utf8_hop       |U8 *s|I32 off
+ApMd   |U8*    |utf8_to_bytes  |U8 *s|STRLEN *len
+ApMd   |U8*    |bytes_from_utf8|U8 *s|STRLEN *len|bool *is_utf8
+ApMd   |U8*    |bytes_to_utf8  |U8 *s|STRLEN *len
+ApMd   |UV     |utf8_to_uv_simple|U8 *s|STRLEN* retlen
+ApMd   |UV     |utf8_to_uv     |U8 *s|STRLEN curlen|STRLEN* retlen|U32 flags
+ApMd   |U8*    |uv_to_utf8     |U8 *d|UV uv
 p      |void   |vivify_defelem |SV* sv
 p      |void   |vivify_ref     |SV* sv|U32 to_what
 p      |I32    |wait4pid       |Pid_t pid|int* statusp|int flags
@@ -2088,12 +2094,12 @@ Ap      |void   |vwarner        |U32 err|const char* pat|va_list* args
 p      |void   |watch          |char** addr
 Ap     |I32    |whichsig       |char* sig
 p      |int    |yyerror        |char* s
-#if defined(USE_PURE_BISON)
+#ifdef USE_PURE_BISON
+p      |int    |yylex_r        |YYSTYPE *lvalp|int *lcharp
 p      |int    |yylex          |YYSTYPE *lvalp|int *lcharp
 #else
 p      |int    |yylex
 #endif
-sp     |int    |syylex
 p      |int    |yyparse
 p      |int    |yywarn         |char* s
 #if defined(MYMALLOC)
@@ -2162,11 +2168,13 @@ Ap      |char*  |sv_2pvbyte_nolen|SV* sv
 Ap     |char*  |sv_pv          |SV *sv
 Ap     |char*  |sv_pvutf8      |SV *sv
 Ap     |char*  |sv_pvbyte      |SV *sv
-Apd      |void   |sv_utf8_upgrade|SV *sv
-ApdM      |bool   |sv_utf8_downgrade|SV *sv|bool fail_ok
-ApdM      |void   |sv_utf8_encode |SV *sv
-Ap      |bool   |sv_utf8_decode |SV *sv
+ApMd   |void   |sv_utf8_upgrade|SV *sv
+ApMd   |bool   |sv_utf8_downgrade|SV *sv|bool fail_ok
+ApMd   |void   |sv_utf8_encode |SV *sv
+ApM    |bool   |sv_utf8_decode |SV *sv
 Ap     |void   |sv_force_normal|SV *sv
+Ap     |void   |sv_add_backref |SV *tsv|SV *sv
+Ap     |void   |sv_del_backref |SV *sv
 Ap     |void   |tmps_grow      |I32 n
 Apd    |SV*    |sv_rvweaken    |SV *sv
 p      |int    |magic_killbackrefs|SV *sv|MAGIC *mg
@@ -2252,6 +2260,7 @@ s |OP*    |no_fh_allowed  |OP *o
 s      |OP*    |scalarboolean  |OP *o
 s      |OP*    |too_few_arguments|OP *o|char* name
 s      |OP*    |too_many_arguments|OP *o|char* name
+s      |U8*    |trlist_upgrade |U8** sp|U8** ep
 s      |void   |op_clear       |OP* o
 s      |void   |null           |OP* o
 s      |PADOFFSET|pad_addlex   |SV* name
@@ -2329,7 +2338,6 @@ s |I32    |dopoptolabel   |char *label
 s      |I32    |dopoptoloop    |I32 startingblock
 s      |I32    |dopoptosub     |I32 startingblock
 s      |I32    |dopoptosub_at  |PERL_CONTEXT* cxstk|I32 startingblock
-s      |void   |free_closures
 s      |void   |save_lines     |AV *array|SV *sv
 s      |OP*    |doeval         |int gimme|OP** startop
 s      |PerlIO *|doopen_pmc    |const char *name|const char *mode
@@ -2357,7 +2365,7 @@ s |regnode*|reg           |I32|I32 *
 s      |regnode*|reganode      |U8|U32
 s      |regnode*|regatom       |I32 *
 s      |regnode*|regbranch     |I32 *|I32
-s      |void   |reguni         |UV|char *|I32*
+s      |void   |reguni         |UV|char *|STRLEN*
 s      |regnode*|regclass
 s      |regnode*|regclassutf8
 s      |I32    |regcurly       |char *
@@ -2456,8 +2464,6 @@ s |void   |del_xrv        |XRV* p
 s      |void   |sv_unglob      |SV* sv
 s      |void   |not_a_number   |SV *sv
 s      |void   |visit          |SVFUNC_t f
-s      |void   |sv_add_backref |SV *tsv|SV *sv
-s      |void   |sv_del_backref |SV *sv
 #  if defined(DEBUGGING)
 s      |void   |del_sv |SV *p
 #  endif
@@ -2520,6 +2526,7 @@ s |SV*|isa_lookup |HV *stash|const char *name|int len|int level
 #endif
 
 #if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT)
+s      |char*  |stdize_locale  |char* locs
 s      |SV*    |mess_alloc
 #  if defined(LEAKTEST)
 s      |void   |xstat          |int