summaryrefslogtreecommitdiff
path: root/embed.fnc
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-04-26 12:12:34 +0100
committerNicholas Clark <nick@ccl4.org>2011-05-18 19:11:03 +0100
commit74e0ddf711449aba3fac400d9102bd461ee7265b (patch)
treef6b7d2f148790a56598095c857b3385db5b79c14 /embed.fnc
parent75f63940310204509f2935729c2b989e3be7c00d (diff)
downloadperl-74e0ddf711449aba3fac400d9102bd461ee7265b.tar.gz
Store the compiled format in mg_ptr instead of after SvCUR() - fixes RT #89218
Formats are compiled down to a sequence of U32 opcodes in doparseform(). Previously the block of opcodes was stored in the buffer of SvPVX() after the raw string by extending the buffer, and calculating the first U32 aligned address after SvCUR(). A flag bit on the scalar was set to signal this hackery, tested with SvCOMPILED() The flag bit used happened to be the same as one of the two used by to signal Boyer-Moore compiled scalars. The assumption was that no scalar can be used for both. Unfortunately, this isn't quite true. Given that the scalar is alway upgraded to PVMG to add PERL_MAGIC_fm magic, to clear the cached compiled version, there's no extra memory cost in using mg_ptr in the MAGIC struct to point directly to the block of U32 opcodes. The test for "is there a compiled version" can switch to mg_find(..., PERL_MAGIC_fm) returning a pointer, and the use of a flag bit abolished. Retain SvCOMPILED() and SvCOMPILED_{on,off}() as compatibility for XS code on CPAN - the first is always 0, the other two now no-ops.
Diffstat (limited to 'embed.fnc')
-rw-r--r--embed.fnc2
1 files changed, 1 insertions, 1 deletions
diff --git a/embed.fnc b/embed.fnc
index f32471cfdf..161729e91a 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -1721,7 +1721,7 @@ snR |char * |bytes_to_uni |NN const U8 *start|STRLEN len|NN char *dest
#if defined(PERL_IN_PP_CTL_C)
sR |OP* |docatch |NULLOK OP *o
sR |OP* |dofindlabel |NN OP *o|NN const char *label|NN OP **opstack|NN OP **oplimit
-s |void |doparseform |NN SV *sv
+s |MAGIC *|doparseform |NN SV *sv
snR |bool |num_overflow |NV value|I32 fldsize|I32 frcsize
sR |I32 |dopoptoeval |I32 startingblock
sR |I32 |dopoptogiven |I32 startingblock