assumption about @_ always being non-REAL doesn't hold when
Gurusamy Sarathy [Sat, 16 Oct 1999 17:18:36 +0000 (17:18 +0000)]
debugger is running; DB::sub() can call arbitrary stuff
that modifies @_ at will

p4raw-id: //depot/perl@4395

pp_hot.c

index 2a398e1..a7fd9dc 100644 (file)
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -2537,7 +2537,13 @@ try_autoload:
                                  "%p entersub preparing @_\n", thr));
 #endif
            av = (AV*)PL_curpad[0];
-           assert(!AvREAL(av));
+           if (AvREAL(av)) {
+               /* @_ is normally not REAL--this should only ever
+                * happen when DB::sub() calls things that modify @_ */
+               av_clear(av);
+               AvREAL_off(av);
+               AvREIFY_on(av);
+           }
 #ifndef USE_THREADS
            cx->blk_sub.savearray = GvAV(PL_defgv);
            GvAV(PL_defgv) = (AV*)SvREFCNT_inc(av);