You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Variables declared in a finally block cause an assertion error in the CPS builder, because one variable is added to the environment multiple times.
This is the assertion that fails:
voidextend(Local element, ir.Primitive value) {
// Assert that the name is not already in the environment. `null` is used// as the name of anonymous variables.assert(!variable2index.containsKey(element));
if (element !=null) variable2index[element] = index2variable.length;
index2variable.add(element);
index2value.add(value);
}
There are a bunch of tests that fail in checked-mode because of this; here is a minimal one:
main() {
try {
print("fdg");
} finally {
var x =12345678;
print(x);
}
}
The variable may be assigned different indices because of different environment sizes at entry points to the finally. I can't see an easy fix to this short of wrapping all variable elements in a "finally element" so different copies of the variable can be distinguished.
The issue should go away when we introduce first-class finally to the IR. I'm not sure if it's worth fixing in the current form.
Variables declared in a finally block cause an assertion error in the CPS builder, because one variable is added to the environment multiple times.
This is the assertion that fails:
There are a bunch of tests that fail in checked-mode because of this; here is a minimal one:
The variable may be assigned different indices because of different environment sizes at entry points to the finally. I can't see an easy fix to this short of wrapping all variable elements in a "finally element" so different copies of the variable can be distinguished.
The issue should go away when we introduce first-class finally to the IR. I'm not sure if it's worth fixing in the current form.
@kmillikin
The text was updated successfully, but these errors were encountered: