$\1 and serious bug in evalling
[p5sagit/p5-mst-13.2.git] / sv.c
diff --git a/sv.c b/sv.c
index f53315a..166dc07 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -952,7 +952,7 @@ register SV *sv;
 
     case SVt_NULL:
        sv_catpv(t, "UNDEF");
-       return tokenbuf;
+       goto finish;
     case SVt_IV:
        sv_catpv(t, "IV");
        break;
@@ -1710,12 +1710,17 @@ STRLEN *lp;
 #endif
     }
     else if (SvIOKp(sv)) {
+       U32 oldIOK = SvIOK(sv);
        if (SvTYPE(sv) < SVt_PVIV)
            sv_upgrade(sv, SVt_PVIV);
        olderrno = errno;       /* some Xenix systems wipe out errno here */
        sv_setpvf(sv, "%Vd", SvIVX(sv));
        errno = olderrno;
        s = SvEND(sv);
+       if (oldIOK)
+           SvIOK_on(sv);
+       else
+           SvIOKp_on(sv);
     }
     else {
        if (dowarn && !localizing && !(SvFLAGS(sv) & SVs_PADTMP))