diff options
author | Salvador FandiƱo <sfandino@yahoo.com> | 2002-11-30 17:24:09 +0000 |
---|---|---|
committer | hv <hv@crypt.org> | 2003-02-16 13:55:10 +0000 |
commit | 06492da604676b8820ba5623ac813ceec4f48731 (patch) | |
tree | 51a6bda59973daccf9c0377e9639e90650598088 /op.c | |
parent | ed25273444c5542e4865fbe422e026b78ba33b80 (diff) | |
download | perl-06492da604676b8820ba5623ac813ceec4f48731.tar.gz |
add support for assertions. Updated form of:
Subject: Re: Did the assertion patch/feature submission get overlooked?
Message-ID: <3DE8F439.50402@yahoo.com>
p4raw-id: //depot/perl@18727
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -5785,6 +5785,7 @@ Perl_ck_subr(pTHX_ OP *o) I32 contextclass = 0; char *e = 0; STRLEN n_a; + bool delete=0; o->op_private |= OPpENTERSUB_HASTARG; for (cvop = o2; cvop->op_sibling; cvop = cvop->op_sibling) ; @@ -5798,9 +5799,18 @@ Perl_ck_subr(pTHX_ OP *o) cv = GvCVu(gv); if (!cv) tmpop->op_private |= OPpEARLY_CV; - else if (SvPOK(cv)) { - namegv = CvANON(cv) ? gv : CvGV(cv); - proto = SvPV((SV*)cv, n_a); + else { + if (SvPOK(cv)) { + namegv = CvANON(cv) ? gv : CvGV(cv); + proto = SvPV((SV*)cv, n_a); + } + if (CvASSERTION(cv)) { + if (PL_hints & HINT_ASSERTING) { + if (PERLDB_ASSERTION && PL_curstash != PL_debstash) + o->op_private |= OPpENTERSUB_DB; + } + else delete=1; + } } } } @@ -5984,6 +5994,10 @@ Perl_ck_subr(pTHX_ OP *o) if (proto && !optional && (*proto && *proto != '@' && *proto != '%' && *proto != ';')) return too_few_arguments(o, gv_ename(namegv)); + if(delete) { + op_free(o); + o=newSVOP(OP_CONST, 0, newSViv(0)); + } return o; } |