This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
_90 op/tie.t gets "Segmentation fault" with Sarathy's perl_call patch
authorGurusamy Sarathy <gsar@engin.umich.edu>
Tue, 25 Feb 1997 19:25:39 +0000 (14:25 -0500)
committerChip Salzenberg <chip@atlantic.net>
Tue, 25 Feb 1997 01:12:02 +0000 (13:12 +1200)
On Tue, 25 Feb 1997 10:07:02 PST, David Dyck wrote:
>
>summary:
>  op/tie.t gets "Segmentation fault" with  Sarathy's perl_call patch
>

Oops.  Thanks for that report (Evil how the segfault doesn't show
up under `make test`. Evil.)

Try this patch. (I was being risque with the runlevel pretense...)

p5p-msgid: <199702251925.OAA15498@aatma.engin.umich.edu>

pp_ctl.c

index 6eab4da..c2f1361 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -1946,10 +1946,10 @@ OP *o;
 {
     int ret;
     int oldrunlevel = runlevel;
 {
     int ret;
     int oldrunlevel = runlevel;
+    OP *oldop = op;
     Sigjmp_buf oldtop;
 
     op = o;
     Sigjmp_buf oldtop;
 
     op = o;
-    runlevel--;                                /* pretense */
     Copy(top_env, oldtop, 1, Sigjmp_buf);
 #ifdef DEBUGGING
     assert(mustcatch == TRUE);
     Copy(top_env, oldtop, 1, Sigjmp_buf);
 #ifdef DEBUGGING
     assert(mustcatch == TRUE);
@@ -1960,6 +1960,7 @@ OP *o;
        Copy(oldtop, top_env, 1, Sigjmp_buf);
        runlevel = oldrunlevel;
        mustcatch = TRUE;
        Copy(oldtop, top_env, 1, Sigjmp_buf);
        runlevel = oldrunlevel;
        mustcatch = TRUE;
+       op = oldop;
        Siglongjmp(top_env, ret);
        /* NOTREACHED */
     case 3:
        Siglongjmp(top_env, ret);
        /* NOTREACHED */
     case 3:
@@ -1977,6 +1978,7 @@ OP *o;
     Copy(oldtop, top_env, 1, Sigjmp_buf);
     runlevel = oldrunlevel;
     mustcatch = TRUE;
     Copy(oldtop, top_env, 1, Sigjmp_buf);
     runlevel = oldrunlevel;
     mustcatch = TRUE;
+    op = oldop;
     return Nullop;
 }
 
     return Nullop;
 }