diff options
author | Adrian M. Enache <enache@rdslink.ro> | 2003-07-19 02:15:37 +0300 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-07-27 15:13:10 +0000 |
commit | 1df3498620ecc1df99a2455e631a135f1710416f (patch) | |
tree | 5eefdb3c46f3a4cd93f5d6352185ac0c5b63a5ac /ext/ByteLoader/ByteLoader.xs | |
parent | 8f33b42a5befbbd0d1d798a463bfe4ac2ba9bf10 (diff) | |
download | perl-1df3498620ecc1df99a2455e631a135f1710416f.tar.gz |
Re: [perl #22984] perl-5.8.1-RC2: TEST -bytecompile won't work at all
Message-ID: <20030718201537.GA1574@ratsnest.hole>
p4raw-id: //depot/perl@20220
Diffstat (limited to 'ext/ByteLoader/ByteLoader.xs')
-rw-r--r-- | ext/ByteLoader/ByteLoader.xs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/ext/ByteLoader/ByteLoader.xs b/ext/ByteLoader/ByteLoader.xs index 4588b02ef0..e71b7cdb9b 100644 --- a/ext/ByteLoader/ByteLoader.xs +++ b/ext/ByteLoader/ByteLoader.xs @@ -1,4 +1,3 @@ -#define PERL_NO_GET_CONTEXT #include "EXTERN.h" #include "perl.h" #include "XSUB.h" @@ -27,7 +26,7 @@ bl_getc(struct byteloader_fdata *data) /* Else there must be at least one byte present, which is good enough */ } - return *((char *) SvPV_nolen (data->datasv) + data->next_out++); + return *((U8 *) SvPV_nolen (data->datasv) + data->next_out++); } int @@ -81,6 +80,7 @@ byteloader_filter(pTHX_ int idx, SV *buf_sv, int maxlen) OP *savestart = PL_main_start; struct byteloader_state bstate; struct byteloader_fdata data; + int len; data.next_out = 0; data.datasv = FILTER_DATA(idx); @@ -92,7 +92,14 @@ byteloader_filter(pTHX_ int idx, SV *buf_sv, int maxlen) bstate.bs_sv = Nullsv; bstate.bs_iv_overflows = 0; - byterun(aTHX_ &bstate); +/* KLUDGE */ + if (byterun(aTHX_ &bstate) + && (len = SvCUR(data.datasv) - (STRLEN)data.next_out)) + { + PerlIO_seek(PL_rsfp, -len, SEEK_CUR); + PL_rsfp = NULL; + } + filter_del(byteloader_filter); if (PL_in_eval) { OP *o; @@ -125,9 +132,3 @@ import(package="ByteLoader", ...) if (!sv) croak ("Could not allocate ByteLoader buffers"); filter_add(byteloader_filter, sv); - -void -unimport(package="ByteLoader", ...) - char *package - PPCODE: - filter_del(byteloader_filter); |