crayon
crayon copied to clipboard
STACK CORRUPTION with continue in a catch block within a loop
Repro:
function main(args) {
for (num : [1, 2, 3]) {
print(num);
try {
print("Try");
throwOnEven(num);
} catch(Exception e) {
print("Catch");
continue;
}
print("Post-try");
}
print("Done");
}
function throwOnEven(n) {
if (n % 2 == 0) throw new Exception();
}
Result: "Done" is skipped on 3. After the catch is triggered, it seems the post-finally behavior for this scope is permanently modified to continue-after-finally (where finally is an implicit empty block in this case)