Don't return a const op for a null sv.
[p5sagit/Devel-BeginLift.git] / BeginLift.xs
index 339f538..9318f0e 100644 (file)
@@ -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