-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdmd.exception-rewrite.dd
More file actions
30 lines (21 loc) · 842 Bytes
/
dmd.exception-rewrite.dd
File metadata and controls
30 lines (21 loc) · 842 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Finally statements are no longer rewritten to a sequence if no Exception was thrown
Finally statements have been allowed to rewrite to sequences when no Exception was throwable from within the try body.
This has been shown to be problematic as cleanup when an Error is thrown does not occur.
By default this has been reverted back to the pre-2018 behavior of not doing the rewrite.
To change this use the new switch `-checkactionfinally=off` to reenable the previous behavior.
This behavior can be observed by running the following code:
```d
import core.stdc.stdio;
void main() {
try {
callMe();
} finally {
printf("exiting!\n");
}
}
void callMe() {
throw new Error("hi there :)");
}
```
When the switch is set to `on`, "exiting!" will be printed.
The `-betterC` switch is unaffected by this change.