summaryrefslogtreecommitdiff
path: root/bytecode.pl
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2006-04-13 21:59:52 +0000
committerNicholas Clark <nick@ccl4.org>2006-04-13 21:59:52 +0000
commit93d343c6c59d1d6b5e6307c31585c77ab830183d (patch)
tree0b9d25fd044eff0a94484ec9596ad6538883596f /bytecode.pl
parent3b0527feddb0a07bea3ee32931f209fea87152bc (diff)
downloadperl-93d343c6c59d1d6b5e6307c31585c77ab830183d.tar.gz
(Hopefully) fix coredumps in ByteLoader, which were a side effect of
fixing a bug in B, and non-robust autogenerated code. When autogenerating initialiser statements for an array, it's a bad plan to have the size of that array hard coded. p4raw-id: //depot/perl@27795
Diffstat (limited to 'bytecode.pl')
-rw-r--r--bytecode.pl7
1 files changed, 5 insertions, 2 deletions
diff --git a/bytecode.pl b/bytecode.pl
index f0763ddf83..4da765a86f 100644
--- a/bytecode.pl
+++ b/bytecode.pl
@@ -90,7 +90,10 @@ for ($i = 0; $i < @optype - 1; $i++) {
printf BYTERUN_C " sizeof(%s),\n", $optype[$i], $i;
}
printf BYTERUN_C " sizeof(%s)\n", $optype[$i], $i;
-print BYTERUN_C <<'EOT';
+
+my $size = @specialsv;
+
+print BYTERUN_C <<"EOT";
};
void *
@@ -110,7 +113,7 @@ byterun(pTHX_ register struct byteloader_state *bstate)
dVAR;
register int insn;
U32 ix;
- SV *specialsv_list[6];
+ SV *specialsv_list[$size];
BYTECODE_HEADER_CHECK; /* croak if incorrect platform */
Newx(bstate->bs_obj_list, 32, void*); /* set op objlist */