summaryrefslogtreecommitdiff
path: root/ext/ByteLoader
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-03-07 09:57:24 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-03-07 09:57:24 +0000
commitfc2904571a077900be0708b6f150c27f77e62f18 (patch)
treef9a9a43d32791298af89c8cb105cf3a11272a9fb /ext/ByteLoader
parent341bd822d2aa170d6da924b2ac1ec314d007122b (diff)
downloadperl-fc2904571a077900be0708b6f150c27f77e62f18.tar.gz
get ByteLoader working again
p4raw-id: //depot/perl@5593
Diffstat (limited to 'ext/ByteLoader')
-rw-r--r--ext/ByteLoader/bytecode.h19
-rw-r--r--ext/ByteLoader/byterun.c4
2 files changed, 19 insertions, 4 deletions
diff --git a/ext/ByteLoader/bytecode.h b/ext/ByteLoader/bytecode.h
index 6e19e129df..1621fed4eb 100644
--- a/ext/ByteLoader/bytecode.h
+++ b/ext/ByteLoader/bytecode.h
@@ -30,8 +30,22 @@ typedef IV IV64;
} \
} STMT_END
-#define BGET_comment_t(arg) \
+#ifdef BYTELOADER_LOG_COMMENTS
+# define BGET_comment_t(arg) \
+ STMT_START { \
+ char buf[1024]; \
+ int i = 0; \
+ do { \
+ arg = BGET_FGETC(); \
+ buf[i++] = (char)arg; \
+ } while (arg != '\n' && arg != EOF); \
+ buf[i] = '\0'; \
+ PerlIO_printf(PerlIO_stderr(), "%s", buf); \
+ } STMT_END
+#else
+# define BGET_comment_t(arg) \
do { arg = BGET_FGETC(); } while (arg != '\n' && arg != EOF)
+#endif
/*
* In the following, sizeof(IV)*4 is just a way of encoding 32 on 64-bit-IV
@@ -113,7 +127,8 @@ typedef IV IV64;
((PMOP*)o)->op_pmregexp = arg ? \
CALLREGCOMP(aTHX_ arg, arg + bytecode_pv.xpv_cur, ((PMOP*)o)) : 0
#define BSET_newsv(sv, arg) sv = NEWSV(666,0); SvUPGRADE(sv, arg)
-#define BSET_newop(o, arg) o = (OP*)safemalloc(optype_size[arg])
+#define BSET_newop(o, arg) ((o = (OP*)safemalloc(optype_size[arg])), \
+ memzero((char*)o,optype_size[arg]))
#define BSET_newopn(o, arg) STMT_START { \
OP *oldop = o; \
BSET_newop(o, arg); \
diff --git a/ext/ByteLoader/byterun.c b/ext/ByteLoader/byterun.c
index 595fd4e18d..a1044ab2c0 100644
--- a/ext/ByteLoader/byterun.c
+++ b/ext/ByteLoader/byterun.c
@@ -431,8 +431,8 @@ byterun(pTHXo_ struct bytestream bs)
}
case INSN_XCV_FLAGS: /* 52 */
{
- U8 arg;
- BGET_U8(arg);
+ U16 arg;
+ BGET_U16(arg);
CvFLAGS(bytecode_sv) = arg;
break;
}