mruby-compiler (codegen): loop info may be NULL (retry)

This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-12-17 10:40:39 +09:00
parent a77b9b4bab
commit 18cc2cea41
+2 -2
View File
@@ -3199,14 +3199,14 @@ codegen(codegen_scope *s, node *tree, int val)
case NODE_RETRY:
{
const char *msg = "unexpected retry";
const struct loopinfo *lp = s->loop;
while (lp && lp->type != LOOP_RESCUE) {
lp = lp->prev;
}
if (!lp) {
raise_error(s, msg);
raise_error(s, "unexpected retry");
break;
}
else {
genjmp(s, OP_JMPUW, lp->pc0);