Commit aba2855c authored by Martin Blix Grydeland's avatar Martin Blix Grydeland

Check for VRT_fail before setting handling on return() in VCL

The compound statement doing return() in VCL may have failed for some
reason, for example running out of workspace while putting together the
reason field. The fail handling would be overwritten by the forced
handling at the end of the generated code for a return statement.

This patch adds a test for the failure condition before forcing the
handling to the result of the return statement.
parent ff8d29ae
......@@ -366,6 +366,7 @@ vcc_act_return(struct vcc *tl, struct token *t, struct symbol *sym)
}
}
ERRCHK(tl);
Fb(tl, 1, "END_;\n");
if (hand == VCL_RET_FAIL)
Fb(tl, 1, "VRT_fail(ctx, \"Failed from VCL\");\n");
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