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
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 *
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 */
arg = arg ? savepv(arg) : arg; \
} STMT_END
-#define BSET_ldspecsv(sv, arg) sv = specialsv_list[arg]
+#define BSET_ldspecsv(sv, arg) STMT_START { \
+ assert(arg < sizeof(specialsv_list) / sizeof(specialsv_list[0])); \
+ sv = specialsv_list[arg]; \
+ } STMT_END
+
#define BSET_ldspecsvx(sv, arg) STMT_START { \
BSET_ldspecsv(sv, arg); \
BSET_OBJ_STOREX(sv); \
dVAR;
register int insn;
U32 ix;
- SV *specialsv_list[6];
+ SV *specialsv_list[7];
BYTECODE_HEADER_CHECK; /* croak if incorrect platform */
Newx(bstate->bs_obj_list, 32, void*); /* set op objlist */