support optional crypt() with PERL_OBJECT
[p5sagit/p5-mst-13.2.git] / pp_ctl.c
index 0750220..8d4b7f7 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -26,7 +26,7 @@
 #define DOCATCH(o) ((CATCH_GET == TRUE) ? docatch(o) : (o))
 
 #ifdef PERL_OBJECT
-#define CALLOP this->*op
+#define CALLOP this->*PL_op
 #else
 #define CALLOP *PL_op
 static OP *docatch _((OP *o));
@@ -2252,6 +2252,10 @@ sv_compile_2op(SV *sv, OP** startop, char *code, AV** avp)
     SAVETMPS;
     /* switch to eval mode */
 
+    if (PL_curcop == &PL_compiling) {
+       SAVESPTR(PL_compiling.cop_stash);
+       PL_compiling.cop_stash = PL_curstash;
+    }
     SAVESPTR(PL_compiling.cop_filegv);
     SAVEI16(PL_compiling.cop_line);
     sprintf(tmpbuf, "_<(%.10s_eval %lu)", code, (unsigned long)++PL_evalseq);
@@ -2318,7 +2322,7 @@ doeval(int gimme, OP** startop)
     SAVEI32(PL_max_intro_pending);
 
     caller = PL_compcv;
-    for (i = cxstack_ix - 1; i >= 0; i--) {
+    for (i = cxstack_ix; i >= 0; i--) {
        PERL_CONTEXT *cx = &cxstack[i];
        if (cx->cx_type == CXt_EVAL)
            break;