-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[asl] Fix unsound controlflow analysis for try .. catch
- Loading branch information
1 parent
8539c82
commit a938b51
Showing
9 changed files
with
156 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
type E of exception {}; | ||
|
||
func test0 () => integer | ||
begin | ||
try return 0; | ||
catch when E => return 1; end; | ||
end; | ||
|
||
func main () => integer | ||
begin | ||
let res = test0(); | ||
assert res == 0; | ||
|
||
return 0; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
type E of exception {}; | ||
|
||
func test0 () => integer | ||
begin | ||
try return 0; | ||
catch when E => print("caught E"); end; | ||
end; | ||
|
||
func main () => integer | ||
begin | ||
let res = test0(); | ||
assert res == 0; | ||
|
||
return 0; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
type E of exception {}; | ||
|
||
func test0 () => integer | ||
begin | ||
try throw E {}; | ||
catch when E => return 1; end; | ||
end; | ||
|
||
func main () => integer | ||
begin | ||
let res = test0(); | ||
assert res == 1; | ||
|
||
return 0; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
type E of exception {}; | ||
|
||
func test0 () => integer | ||
begin | ||
try return 0; | ||
catch | ||
when E => return 1; | ||
otherwise => throw E {}; | ||
end; | ||
end; | ||
|
||
func main () => integer | ||
begin | ||
let res = test0(); | ||
assert res == 0; | ||
|
||
return 0; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
type E of exception {}; | ||
|
||
func test0 () => integer | ||
begin | ||
try return 0; | ||
catch | ||
when E => return 1; | ||
otherwise => println("Otherwise"); | ||
end; | ||
end; | ||
|
||
func main () => integer | ||
begin | ||
let res = test0(); | ||
assert res == 0; | ||
|
||
return 0; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
type E of exception {}; | ||
type F of exception {}; | ||
|
||
func test0 () => integer | ||
begin | ||
try throw E {}; | ||
catch | ||
when E => return 1; | ||
when F => println("Caught F"); | ||
otherwise => throw E {}; | ||
end; | ||
end; | ||
|
||
func main () => integer | ||
begin | ||
let res = test0(); | ||
assert res == 0; | ||
|
||
return 0; | ||
end; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
type E of exception {}; | ||
|
||
func test0 () => integer | ||
begin | ||
try print("body"); | ||
catch | ||
when E => return 1; | ||
otherwise => throw E {}; | ||
end; | ||
end; | ||
|
||
func main () => integer | ||
begin | ||
let res = test0(); | ||
assert res == 0; | ||
|
||
return 0; | ||
end; |