diff options
Diffstat (limited to 'ext/ByteLoader')
-rw-r--r-- | ext/ByteLoader/bytecode.h | 11 | ||||
-rw-r--r-- | ext/ByteLoader/byterun.c | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/ext/ByteLoader/bytecode.h b/ext/ByteLoader/bytecode.h index 50198ece82..9df93ffd76 100644 --- a/ext/ByteLoader/bytecode.h +++ b/ext/ByteLoader/bytecode.h @@ -376,6 +376,17 @@ typedef char *pvindex; SvREFCNT_dec(w); \ } \ } STMT_END +#define BSET_gp_file(gv, file) \ + STMT_START { \ + STRLEN len = strlen(file); \ + U32 hash; \ + PERL_HASH(hash, file, len); \ + if(GvFILE_HEK(gv)) { \ + Perl_unshare_hek(aTHX_ GvFILE_HEK(gv)); \ + } \ + GvGP(gv)->gp_file_hek = share_hek(file, len, hash); \ + Safefree(file); \ + } 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 diff --git a/ext/ByteLoader/byterun.c b/ext/ByteLoader/byterun.c index 77568ba2c6..3738ad5bdd 100644 --- a/ext/ByteLoader/byterun.c +++ b/ext/ByteLoader/byterun.c @@ -658,7 +658,7 @@ byterun(pTHX_ register struct byteloader_state *bstate) { pvindex arg; BGET_pvindex(arg); - GvFILE(bstate->bs_sv) = arg; + BSET_gp_file(bstate->bs_sv, arg); break; } case INSN_GP_IO: /* 86 */ |