From: Gurusamy Sarathy Date: Fri, 13 Jun 1997 03:34:36 +0000 (+1200) Subject: Re: Calling Perl from within C from within Perl X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d6602a8c317a25957738ed94749408b8c40cda5f;p=p5sagit%2Fp5-mst-13.2.git Re: Calling Perl from within C from within Perl On Mon, 30 Jun 1997 13:26:33 EDT, Kenneth Albanowski wrote: >[GIMME after perl_call*() coredumps] >Is perl_call_sv mucking with the current op? That's the only problem that >looks vaguely reasonable. op will be null after perl_call_sv(), and GIMME looks in op to find the context. I tend to use GIMME only in the declaration initializers, so have never run into this trap before. I recommend this patch. p5p-msgid: 199706301829.OAA05426@aatma.engin.umich.edu private-msgid: 199706301842.OAA05569@aatma.engin.umich.edu --- diff --git a/perl.c b/perl.c index 8ef13a3..7c84173 100644 --- a/perl.c +++ b/perl.c @@ -1017,6 +1017,7 @@ I32 flags; /* See G_* flags in cop.h */ bool oldcatch = CATCH_GET; dJMPENV; int ret; + OP* oldop = op; if (flags & G_DISCARD) { ENTER; @@ -1139,6 +1140,7 @@ I32 flags; /* See G_* flags in cop.h */ FREETMPS; LEAVE; } + op = oldop; return retval; }