Closed maranget closed 4 months ago
Thinking twice, it is normal for the print
statement to be executed twice. However, the fatal error is an actual bug.
Here is a simpler example:
ASL U
{ }
type Coucou of exception {};
func f(a:integer) => integer
begin
let b = SomeBoolean();
if b then
throw Coucou { };
end
return a;
end
func main() => integer
begin
let x=0;
try
let z = f(x);
print(z);
catch
when Coucou =>
assert TRUE;
end
return 0;
end
Running the test above, we have:
% herd7 U.litmus
0
0
Warning: Uncaught exception: Coucou {}
Hi @HadrienRenaud. the semantics of throw looks too eager in the concurrent case. Consider the following test:
Executing the above test with
herd7 U.litmus
results in printing1010
twice.Even more serious we have a fatal error when the exception has an argument:
Running the test results in a fatal error: