Fixed codegen error of redo in rescue; fix #3422

The issue (and the fix) was reported by https://hackerone.com/dgaletic
parent c2ddcd45
......@@ -2038,7 +2038,7 @@ codegen(codegen_scope *s, node *tree, int val)
break;
case NODE_REDO:
if (!s->loop) {
if (!s->loop || s->loop->type == LOOP_BEGIN || s->loop->type == LOOP_RESCUE) {
raise_error(s, "unexpected redo");
}
else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment