From: Florian Ragwitz Date: Sat, 18 Oct 2008 12:22:44 +0000 (+0000) Subject: Don't return a const op for a null sv. X-Git-Tag: 0.001001~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4ebcd16b11bd1e801871999cabe6dd0a228edb19;hp=9fb219882ce159f1d730f089476a2eeb97e57a3c;p=p5sagit%2FDevel-BeginLift.git Don't return a const op for a null sv. --- diff --git a/BeginLift.xs b/BeginLift.xs index 339f538..9318f0e 100644 --- a/BeginLift.xs +++ b/BeginLift.xs @@ -137,6 +137,11 @@ STATIC OP *dbl_ck_entersub(pTHX_ OP *o) { if (type == OP_RV2GV) return newGVOP(OP_GV, 0, (GV*)sv); + if (SvTYPE(sv) == SVt_NULL) { + op_free(o); + return newOP(OP_NULL, 0); + } + return newSVOP(OP_CONST, 0, sv); } else { /* this bit not lifted, handles the 'sub doesn't return stuff' case