diff options
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -3549,9 +3549,19 @@ PP(pp_entereval) MUTEX_UNLOCK(&PL_eval_mutex); #endif /* USE_5005THREADS */ ok = doeval(gimme, NULL, runcv, seq); - if ((PERLDB_LINE || PERLDB_SAVESRC) - && was != (I32)PL_sub_generation /* Some subs defined here. */ - && ok) { + if (ok ? (was != (I32)PL_sub_generation /* Some subs defined here. */ + ? (PERLDB_LINE || PERLDB_SAVESRC) + : PERLDB_SAVESRC_NOSUBS) + : 0 /* PERLDB_SAVESRC_INVALID */ + /* Much that I'd like to think that it was this trivial to add this + feature, it's not, due to + lex_end(); + LEAVE; + in S_doeval() for the failure case. So really we want a more + sophisticated way of (optionally) clearing the source code. + Particularly as the current way is buggy, as a syntactically + invalid eval string can still define a subroutine that is retained, + and the user may wish to breakpoint. */) { /* Copy in anything fake and short. */ my_strlcpy(safestr, fakestr, fakelen); } |