From 28ad8aa9e07f9622de3483cf67ae688a51c1cbdb Mon Sep 17 00:00:00 2001 From: underscorediscovery Date: Fri, 10 Jul 2020 19:14:54 -0700 Subject: [PATCH] compiler; fix incorrect byte length for CODE_IMPORT_VARIABLE 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 :100: --- src/vm/wren_compiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vm/wren_compiler.c b/src/vm/wren_compiler.c index b8961f7f..ee8eb78a 100644 --- a/src/vm/wren_compiler.c +++ b/src/vm/wren_compiler.c @@ -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: @@ -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: