diff options
author | Nicholas Clark <nick@ccl4.org> | 2010-11-01 17:16:29 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2010-11-01 17:16:29 +0000 |
commit | 227aaa42ba4aa82332777bb2eee8d1fc74aba92e (patch) | |
tree | 3ffcfbbda67ef1859761ed2b213fb473db9f7c7e /ext | |
parent | 7a2c16aa3f95e6a8316b1dd3d0213f7ab9310458 (diff) | |
download | perl-227aaa42ba4aa82332777bb2eee8d1fc74aba92e.tar.gz |
Correct the return type for B::MAGIC::MOREMAGIC.
b2adfa9b5e1682df accidentally changed the return type from SV to B::SV.
Clearly there aren't enough tests.
However, the code prior to b2adfa9b5e1682df was buggy (now fixed) in that it
could put a NULL on the perl stack. The stack should only be valid SV pointers.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/B/B.xs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs index 94b2bc9984..b32816c15b 100644 --- a/ext/B/B.xs +++ b/ext/B/B.xs @@ -1719,9 +1719,8 @@ MOREMAGIC(mg) case 8: if (mg->mg_type == PERL_MAGIC_qr) { REGEXP *rx = (REGEXP *)mg->mg_obj; - PUSHs(make_sv_object(aTHX_ NULL, - rx ? newSVpvn( RX_PRECOMP(rx), RX_PRELEN(rx)) - : NULL)); + PUSHs(newSVpvn_flags(rx ? RX_PRECOMP(rx) : NULL, + rx ? RX_PRELEN(rx) : 0, SVs_TEMP)); } else { croak( "precomp is only meaningful on r-magic" ); } |