#define BGET_op_tr_array(arg) do { \
unsigned short *ary; \
- int i; \
New(666, ary, 256, unsigned short); \
BGET_FREAD(ary, sizeof(unsigned short), 256); \
arg = (char *) ary; \
hv_store((HV*)sv, bstate->bs_pv.xpv_pv, bstate->bs_pv.xpv_cur, arg, 0)
#define BSET_pv_free(pv) Safefree(pv.xpv_pv)
#define BSET_pregcomp(o, arg) \
- ((PMOP*)o)->op_pmregexp = arg ? \
- CALLREGCOMP(aTHX_ arg, arg + bstate->bs_pv.xpv_cur, ((PMOP*)o)) : 0
+ (PM_SETRE(((PMOP*)o), (arg ? \
+ CALLREGCOMP(aTHX_ arg, arg + bstate->bs_pv.xpv_cur, ((PMOP*)o)) : 0)))
#define BSET_newsv(sv, arg) \
STMT_START { \
sv = (arg == SVt_PVAV ? (SV*)newAV() : \
ENTER; \
SAVECOPFILE(&PL_compiling); \
SAVECOPLINE(&PL_compiling); \
- save_svref(&PL_rs); \
- sv_setsv(PL_rs, PL_nrs); \
if (!PL_beginav) \
PL_beginav = newAV(); \
av_push(PL_beginav, cv); \
} STMT_END
#define BSET_OBJ_STORE(obj, ix) \
(I32)ix > bstate->bs_obj_list_fill ? \
- bset_obj_store(aTHXo_ bstate, obj, (I32)ix) : (bstate->bs_obj_list[ix] = obj)
+ bset_obj_store(aTHX_ bstate, obj, (I32)ix) : (bstate->bs_obj_list[ix] = obj)
/* 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 'require 5.6.0' or
* -- BKS, June 2000
*/
-#define HEADER_FAIL(f, arg1, arg2) \
+#define HEADER_FAIL(f) \
+ Perl_croak(aTHX_ "Invalid bytecode for this architecture: " f)
+#define HEADER_FAIL1(f, arg1) \
+ Perl_croak(aTHX_ "Invalid bytecode for this architecture: " f, arg1)
+#define HEADER_FAIL2(f, arg1, arg2) \
Perl_croak(aTHX_ "Invalid bytecode for this architecture: " f, arg1, arg2)
#define BYTECODE_HEADER_CHECK \
\
BGET_U32(sz); /* Magic: 'PLBC' */ \
if (sz != 0x43424c50) { \
- HEADER_FAIL("bad magic (want 0x43424c50, got %#x)", sz, 0); \
+ HEADER_FAIL1("bad magic (want 0x43424c50, got %#x)", (int)sz); \
} \
BGET_strconst(str); /* archname */ \
if (strNE(str, ARCHNAME)) { \
- HEADER_FAIL("wrong architecture (want %s, you have %s)",str,ARCHNAME); \
+ HEADER_FAIL2("wrong architecture (want %s, you have %s)",str,ARCHNAME); \
} \
BGET_strconst(str); /* ByteLoader version */ \
if (strNE(str, VERSION)) { \
- HEADER_FAIL("mismatched ByteLoader versions (want %s, you have %s)", \
+ HEADER_FAIL2("mismatched ByteLoader versions (want %s, you have %s)", \
str, VERSION); \
} \
BGET_U32(sz); /* ivsize */ \
if (sz != IVSIZE) { \
- HEADER_FAIL("different IVSIZE", 0, 0); \
+ HEADER_FAIL("different IVSIZE"); \
} \
BGET_U32(sz); /* ptrsize */ \
if (sz != PTRSIZE) { \
- HEADER_FAIL("different PTRSIZE", 0, 0); \
+ HEADER_FAIL("different PTRSIZE"); \
} \
BGET_strconst(str); /* byteorder */ \
if (strNE(str, STRINGIFY(BYTEORDER))) { \
- HEADER_FAIL("different byteorder", 0, 0); \
+ HEADER_FAIL("different byteorder"); \
} \
} STMT_END