Skip to content

Commit

Permalink
compiler; fix incorrect byte length for CODE_IMPORT_VARIABLE
Browse files Browse the repository at this point in the history
this can lead to some REALLY fun debugging because various code bytes/instructions get skipped, leading to wrong inputs into wrong opcodes and all sorts 💯
  • Loading branch information
ruby0x1 committed Jul 11, 2020
1 parent b3d496e commit 28ad8aa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/vm/wren_compiler.c
Expand Up @@ -2762,6 +2762,7 @@ static int getByteCountForArguments(const uint8_t* bytecode,
case CODE_METHOD_INSTANCE:
case CODE_METHOD_STATIC:
case CODE_IMPORT_MODULE:
case CODE_IMPORT_VARIABLE:
return 2;

case CODE_SUPER_0:
Expand All @@ -2781,7 +2782,6 @@ static int getByteCountForArguments(const uint8_t* bytecode,
case CODE_SUPER_14:
case CODE_SUPER_15:
case CODE_SUPER_16:
case CODE_IMPORT_VARIABLE:
return 4;

case CODE_CLOSURE:
Expand Down

0 comments on commit 28ad8aa

Please sign in to comment.