1
0
mirror of https://github.com/irssi/irssi.git synced 2024-06-30 06:45:25 +00:00

Merge pull request #52 from dgl/stack-cleanup

Correct use of perl stack macros
This commit is contained in:
Alexander Færøy 2014-06-29 14:27:12 +02:00
commit aaa0cb6e03
6 changed files with 8 additions and 12 deletions

View File

@ -74,6 +74,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);
@ -82,9 +86,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;

View File

@ -249,9 +249,9 @@ void irssi_callXS(void (*subaddr)(pTHX_ CV* cv), CV *cv, SV **mark)
dSP;
PUSHMARK(mark);
(*subaddr)(aTHX_ cv);
PUTBACK;
(*subaddr)(aTHX_ cv);
}
void perl_chatnet_fill_hash(HV *hv, CHATNET_REC *chatnet)

View File

@ -59,9 +59,6 @@ static void perl_script_destroy_package(PERL_SCRIPT_REC *script)
perl_call_pv("Irssi::Core::destroy", G_VOID|G_EVAL|G_DISCARD);
SPAGAIN;
PUTBACK;
FREETMPS;
LEAVE;
}

View File

@ -345,7 +345,6 @@ static void perl_call_signal(PERL_SCRIPT_REC *script, SV *func,
}
}
PUTBACK;
FREETMPS;
LEAVE;
}

View File

@ -69,7 +69,6 @@ static void perl_source_destroy(PERL_SOURCE_REC *rec)
static int perl_source_event(PERL_SOURCE_REC *rec)
{
dSP;
int retcount;
ENTER;
SAVETMPS;
@ -79,8 +78,7 @@ static int perl_source_event(PERL_SOURCE_REC *rec)
PUTBACK;
perl_source_ref(rec);
retcount = perl_call_sv(rec->func, G_EVAL|G_SCALAR);
SPAGAIN;
perl_call_sv(rec->func, G_EVAL|G_DISCARD);
if (SvTRUE(ERRSV)) {
char *error = g_strdup(SvPV_nolen(ERRSV));
@ -91,7 +89,6 @@ static int perl_source_event(PERL_SOURCE_REC *rec)
if (perl_source_unref(rec) && rec->once)
perl_source_destroy(rec);
PUTBACK;
FREETMPS;
LEAVE;

View File

@ -90,7 +90,6 @@ static void perl_statusbar_event(char *function, SBAR_ITEM_REC *item,
}
}
PUTBACK;
FREETMPS;
LEAVE;
}