summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-02-13 19:02:07 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-02-13 19:02:07 +0000
commit0f79a09d62eb410185d697430134f937ab4e917d (patch)
tree79a361d65e09a6a28c1ab478935463a3d36adb2e /pp_ctl.c
parent8ecf71871febb31312d723e89648aadebf858ae1 (diff)
downloadperl-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 'pp_ctl.c')
-rw-r--r--pp_ctl.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 7b4cbfea49..030bcbd166 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1526,10 +1526,10 @@ PP(pp_caller)
if (cx->blk_eval.old_op_type == OP_ENTEREVAL) {
PUSHs(cx->blk_eval.cur_text);
PUSHs(&PL_sv_no);
- }
- else if (cx->blk_eval.old_name) { /* Try blocks have old_name == 0. */
- /* Require, put the name. */
- PUSHs(sv_2mortal(newSVpv(cx->blk_eval.old_name, 0)));
+ }
+ /* try blocks have old_namesv == 0 */
+ else if (cx->blk_eval.old_namesv) {
+ PUSHs(sv_2mortal(newSVsv(cx->blk_eval.old_namesv)));
PUSHs(&PL_sv_yes);
}
}
@@ -1813,9 +1813,9 @@ PP(pp_return)
(MARK == SP || (gimme == G_SCALAR && !SvTRUE(*SP))) )
{
/* Unassume the success we assumed earlier. */
- char *name = cx->blk_eval.old_name;
- (void)hv_delete(GvHVn(PL_incgv), name, strlen(name), G_DISCARD);
- DIE(aTHX_ "%s did not return a true value", name);
+ SV *nsv = cx->blk_eval.old_namesv;
+ (void)hv_delete(GvHVn(PL_incgv), SvPVX(nsv), SvCUR(nsv), G_DISCARD);
+ DIE(aTHX_ "%s did not return a true value", SvPVX(nsv));
}
break;
case CXt_FORMAT:
@@ -3294,9 +3294,9 @@ PP(pp_leaveeval)
!(gimme == G_SCALAR ? SvTRUE(*SP) : SP > newsp))
{
/* Unassume the success we assumed earlier. */
- char *name = cx->blk_eval.old_name;
- (void)hv_delete(GvHVn(PL_incgv), name, strlen(name), G_DISCARD);
- retop = Perl_die(aTHX_ "%s did not return a true value", name);
+ SV *nsv = cx->blk_eval.old_namesv;
+ (void)hv_delete(GvHVn(PL_incgv), SvPVX(nsv), SvCUR(nsv), G_DISCARD);
+ retop = Perl_die(aTHX_ "%s did not return a true value", SvPVX(nsv));
/* die_where() did LEAVE, or we won't be here */
}
else {