diff options
author | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2018-03-27 09:10:11 +0100 |
---|---|---|
committer | Dagfinn Ilmari Mannsåker <ilmari@ilmari.org> | 2018-03-27 09:12:16 +0100 |
commit | 7329ac997ee70d1a01ebaf5020183d9de8f5e51a (patch) | |
tree | dc8eda4ef3b4f238c2c75908c76f357345d22755 /ext | |
parent | 0cc3cc274e71bf1211f53331f706d17b75acdd54 (diff) | |
download | perl-7329ac997ee70d1a01ebaf5020183d9de8f5e51a.tar.gz |
Fix building with -Accflags=-DDL_UNLOAD_ALL_AT_EXIT
Commit bb6a367ad5d replaced an XPUSHs inside a loop with an EXTEND
outside it, but didn't move the dSP to match. Even if it did, that
would have been wrong, since the loop might push more than one value.
Revert that bit of the commit.
In passing, move the declaration of dl_librefs and dl_libref into the
scope where they're used.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/DynaLoader/dlutils.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/ext/DynaLoader/dlutils.c b/ext/DynaLoader/dlutils.c index 557c0ec1db..ad5dd26aba 100644 --- a/ext/DynaLoader/dlutils.c +++ b/ext/DynaLoader/dlutils.c @@ -75,18 +75,15 @@ static void dl_unload_all_files(pTHX_ void *unused) { CV *sub; - AV *dl_librefs; - SV *dl_libref; - if ((sub = get_cvs("DynaLoader::dl_unload_file", 0)) != NULL) { - dl_librefs = get_av("DynaLoader::dl_librefs", 0); - EXTEND(SP,1); + AV *dl_librefs = get_av("DynaLoader::dl_librefs", 0); + SV *dl_libref; while ((dl_libref = av_pop(dl_librefs)) != &PL_sv_undef) { dSP; ENTER; SAVETMPS; PUSHMARK(SP); - PUSHs(sv_2mortal(dl_libref)); + XPUSHs(sv_2mortal(dl_libref)); PUTBACK; call_sv((SV*)sub, G_DISCARD | G_NODEBUG); FREETMPS; |