From ecd04c98ca7b8e8e6f5b89e4a5d867cc1554f7a7 Mon Sep 17 00:00:00 2001 From: Jarkko Hietaniemi Date: Wed, 20 Aug 2003 10:49:51 +0000 Subject: [PATCH] Patch from Enache for the crashing of bytecode.t in Tru64. p4raw-id: //depot/perl@20789 --- ext/B/B/Bytecode.pm | 2 +- ext/ByteLoader/bytecode.h | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ext/B/B/Bytecode.pm b/ext/B/B/Bytecode.pm index 826ae5b..8580885 100644 --- a/ext/B/B/Bytecode.pm +++ b/ext/B/B/Bytecode.pm @@ -358,7 +358,7 @@ sub B::AV::bsave { nice "-AV-", asm "ldsv", $varix = $ix unless $ix == $varix; - asm "av_extend", $av->MAX; + asm "av_extend", $av->MAX if $av->MAX >= 0; asm "av_pushx", $_ for @array; asm "sv_refcnt", $av->REFCNT; asm "xav_flags", $av->AvFLAGS; diff --git a/ext/ByteLoader/bytecode.h b/ext/ByteLoader/bytecode.h index a9de88f..8ca9382 100644 --- a/ext/ByteLoader/bytecode.h +++ b/ext/ByteLoader/bytecode.h @@ -171,10 +171,17 @@ typedef char *pvindex; #define BSET_newsv(sv, arg) \ - STMT_START { \ - sv = NEWSV(0,0); \ - SvUPGRADE(sv, (arg)); \ - } STMT_END + switch(arg) { \ + case SVt_PVAV: \ + sv = (SV*)newAV(); \ + break; \ + case SVt_PVHV: \ + sv = (SV*)newHV(); \ + break; \ + default: \ + sv = NEWSV(0,0); \ + SvUPGRADE(sv, (arg)); \ + } #define BSET_newsvx(sv, arg) STMT_START { \ BSET_newsv(sv, arg & SVTYPEMASK); \ SvFLAGS(sv) = arg; \ -- 2.7.4