diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 2000-02-13 19:02:07 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 2000-02-13 19:02:07 +0000 |
commit | 0f79a09d62eb410185d697430134f937ab4e917d (patch) | |
tree | 79a361d65e09a6a28c1ab478935463a3d36adb2e /cop.h | |
parent | 8ecf71871febb31312d723e89648aadebf858ae1 (diff) | |
download | perl-0f79a09d62eb410185d697430134f937ab4e917d.tar.gz |
more purification (pp_require() could access free memory; vdie()
could think message was random length when passed a null argument;
utilize() didn't set up the hash for the method name leading to
pp_method_named() accessing random state; PL_curpm wasn't zeroed
properly)
p4raw-id: //depot/perl@5072
Diffstat (limited to 'cop.h')
-rw-r--r-- | cop.h | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -149,23 +149,28 @@ struct block_sub { struct block_eval { I32 old_in_eval; I32 old_op_type; - char * old_name; + SV * old_namesv; OP * old_eval_root; SV * cur_text; }; #define PUSHEVAL(cx,n,fgv) \ + STMT_START { \ cx->blk_eval.old_in_eval = PL_in_eval; \ cx->blk_eval.old_op_type = PL_op->op_type; \ - cx->blk_eval.old_name = (n ? savepv(n) : Nullch); \ + cx->blk_eval.old_namesv = (n ? newSVpv(n,0) : Nullsv); \ cx->blk_eval.old_eval_root = PL_eval_root; \ - cx->blk_eval.cur_text = PL_linestr; + cx->blk_eval.cur_text = PL_linestr; \ + } STMT_END #define POPEVAL(cx) \ + STMT_START { \ PL_in_eval = cx->blk_eval.old_in_eval; \ optype = cx->blk_eval.old_op_type; \ PL_eval_root = cx->blk_eval.old_eval_root; \ - Safefree(cx->blk_eval.old_name); + if (cx->blk_eval.old_namesv) \ + sv_2mortal(cx->blk_eval.old_namesv); \ + } STMT_END /* loop context */ struct block_loop { |