From a4c687efad0a889b535ad2afd958dc6c3523e33a Mon Sep 17 00:00:00 2001 From: "Ben (X13/Arch)" Date: Mon, 13 May 2024 23:35:26 +0200 Subject: [PATCH] Fixed switch fallback when jumptable doens't work --- lib/vm.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/vm.c b/lib/vm.c index e41f59ed..f0590351 100644 --- a/lib/vm.c +++ b/lib/vm.c @@ -204,6 +204,7 @@ lVal lBytecodeEval(lClosure *callingClosure, lBytecodeArray *text){ ip = ops->data; while(true){ + dispatchLoop: vmdispatch(*ip++){ vmcase(lopNOP) vmbreak; @@ -517,7 +518,7 @@ lVal lBytecodeEval(lClosure *callingClosure, lBytecodeArray *text){ while(t){ if(s == t->key){ ctx.valueStack[++ctx.sp] = t->value; - vmbreak; + goto dispatchLoop; } t = s > t->key ? t->right : t->left; } @@ -544,7 +545,7 @@ lVal lBytecodeEval(lClosure *callingClosure, lBytecodeArray *text){ while(t){ if(t->key == s){ t->value = ctx.valueStack[ctx.sp]; - vmbreak; + goto dispatchLoop; } t = s > t->key ? t->right : t->left; }