summaryrefslogtreecommitdiffstats
path: root/byterun/fix_code.c
diff options
context:
space:
mode:
authorFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>2014-05-04 20:14:23 +0000
committerFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>2014-05-04 20:14:23 +0000
commit680fe9f91d2ba04f09c86b06f1dd84919c054b26 (patch)
tree2fded4d28dedbe565c446a7a04b6026867314707 /byterun/fix_code.c
parentc141951f2a88ce5e32b5a80552f74c5c8d1dd148 (diff)
Add FIRST_UNIMPLEMENTED_OP instructioon to simplify bootstrapping after adding new bytecode instructions at the end
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14734 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'byterun/fix_code.c')
-rw-r--r--byterun/fix_code.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/byterun/fix_code.c b/byterun/fix_code.c
index 746f8b750..3380dc919 100644
--- a/byterun/fix_code.c
+++ b/byterun/fix_code.c
@@ -98,10 +98,10 @@ char * caml_instr_base;
void caml_thread_code (code_t code, asize_t len)
{
code_t p;
- int l [STOP + 1];
+ int l [FIRST_UNIMPLEMENTED_OP];
int i;
- for (i = 0; i <= STOP; i++) {
+ for (i = 0; i < FIRST_UNIMPLEMENTED_OP; i++) {
l [i] = 0;
}
/* Instructions with one operand */
@@ -125,7 +125,7 @@ void caml_thread_code (code_t code, asize_t len)
len /= sizeof(opcode_t);
for (p = code; p < code + len; /*nothing*/) {
opcode_t instr = *p;
- if (instr < 0 || instr > STOP){
+ if (instr < 0 || instr >= FIRST_UNIMPLEMENTED_OP){
/* FIXME -- should Assert(false) ?
caml_fatal_error_arg ("Fatal error in fix_code: bad opcode (%lx)\n",
(char *)(long)instr);