diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-05-23 21:36:06 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-06-11 09:40:01 +0200 |
commit | bc9a525687b7ccee10de7bc6f6a729645b1058dd (patch) | |
tree | 2221f1debd001579230e38ef1a3673cd26890cd6 /pp.c | |
parent | ccbcbb3d6584c01ff4c18f0e39e86d6eb181eb4d (diff) | |
download | perl-bc9a525687b7ccee10de7bc6f6a729645b1058dd.tar.gz |
Don't allow study on an FBM scalar, to give more flexibility in SV flag usage.
No real-world code would ever end up studying an FBM scalar, so this isn't a
real pessimisation.
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -718,12 +718,15 @@ PP(pp_study) RETPUSHYES; } s = (unsigned char*)(SvPV(sv, len)); - if (len == 0 || len > I32_MAX || !SvPOK(sv) || SvUTF8(sv)) { + if (len == 0 || len > I32_MAX || !SvPOK(sv) || SvUTF8(sv) || SvVALID(sv)) { /* No point in studying a zero length string, and not safe to study anything that doesn't appear to be a simple scalar (and hence might change between now and when the regexp engine runs without our set magic ever running) such as a reference to an object with overloaded - stringification. */ + stringification. Also refuse to study an FBM scalar, as this gives + more flexibility in SV flag usage. No real-world code would ever + end up studying an FBM scalar, so this isn't a real pessimisation. + */ RETPUSHNO; } pos = len; |