diff options
author | Nicholas Clark <nick@ccl4.org> | 2006-04-13 12:40:24 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2006-04-13 12:40:24 +0000 |
commit | 5c3c3f81c4e0c229b48dd3a3b920635017d32c46 (patch) | |
tree | 390e26b80af46139114cf98e389c2bfa2bd678fe /ext/ByteLoader/bytecode.h | |
parent | 8fbc55279aa56e88684b31864922ee4cfa976b1a (diff) | |
download | perl-5c3c3f81c4e0c229b48dd3a3b920635017d32c46.tar.gz |
Fix B and ByteLoader to cope with cop_warnings no longer being an SV.
p4raw-id: //depot/perl@27786
Diffstat (limited to 'ext/ByteLoader/bytecode.h')
-rw-r--r-- | ext/ByteLoader/bytecode.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ext/ByteLoader/bytecode.h b/ext/ByteLoader/bytecode.h index 13f851040e..7ba0236313 100644 --- a/ext/ByteLoader/bytecode.h +++ b/ext/ByteLoader/bytecode.h @@ -349,6 +349,18 @@ typedef char *pvindex; #define BSET_xhv_name(hv, name) hv_name_set((HV*)hv, name, strlen(name), 0) #define BSET_cop_arybase(c, b) CopARYBASE_set(c, b) +#define BSET_cop_warnings(c, w) \ + STMT_START { \ + if (specialWARN((STRLEN *)w)) { \ + c->cop_warnings = (STRLEN *)w; \ + } else { \ + STRLEN len; \ + const char *const p = SvPV_const(w, len); \ + c->cop_warnings = \ + Perl_new_warnings_bitfield(aTHX_ NULL, p, len); \ + SvREFCNT_dec(w); \ + } \ + } STMT_END /* NOTE: the bytecode header only sanity-checks the bytecode. If a script cares about * what version of Perl it's being called under, it should do a 'use 5.006_001' or |