summaryrefslogtreecommitdiff
path: root/src/perl/common
diff options
context:
space:
mode:
authorDavid Leadbeater <dgl@dgl.cx>2014-06-19 18:31:00 +0100
committerDavid Leadbeater <dgl@dgl.cx>2014-06-27 11:20:48 +0100
commitc5d81c598d7872308725f4f20523a1c593d5ca9e (patch)
tree3dbabd8670d4829ff50500c88503ff82b3c8fd15 /src/perl/common
parent9d0d4d9437649ed96381120e68a8d4035f6ded7e (diff)
downloadirssi-c5d81c598d7872308725f4f20523a1c593d5ca9e.zip
Correct use of perl stack macros
Further to pull #49 this is the result of an audit of the use of perl stack macros. There were several cases where PUTBACK was being called where the stack pointer could be out-of-date. Also some misc. cleanup where the macros were used needlessly.
Diffstat (limited to 'src/perl/common')
-rw-r--r--src/perl/common/Expando.xs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/perl/common/Expando.xs b/src/perl/common/Expando.xs
index 31b4f990..545d6891 100644
--- a/src/perl/common/Expando.xs
+++ b/src/perl/common/Expando.xs
@@ -73,6 +73,10 @@ static char *perl_expando_event(PerlExpando *rec, SERVER_REC *server,
ret = NULL;
if (SvTRUE(ERRSV)) {
+ (void) POPs;
+ /* call putback before emitting script error signal as that
+ * could manipulate the perl stack. */
+ PUTBACK;
/* make sure we don't get back here */
if (rec->script != NULL)
script_unregister_expandos(rec->script);
@@ -81,9 +85,9 @@ static char *perl_expando_event(PerlExpando *rec, SERVER_REC *server,
} else if (retcount > 0) {
ret = g_strdup(POPp);
*free_ret = TRUE;
+ PUTBACK;
}
- PUTBACK;
FREETMPS;
LEAVE;