-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ fix ] Fix issue with eager evaluation of crashing functions (fixes #…
…3003) (#3004) * [ fix ] Fix issue with eager evaluation of crashing functions * Mark functions that call unsafe builtins as non-constant * Better detection of crash primop when deciding if functions can be constant
- Loading branch information
1 parent
5dcf624
commit ecf4765
Showing
7 changed files
with
62 additions
and
3 deletions.
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,14 @@ | ||
-- no_clauses.idr | ||
%default total | ||
|
||
bad : (0 _ : Z = S Z) -> Void | ||
bad _ impossible | ||
|
||
data BadPrf = Ok | No (Z = S Z) | ||
|
||
Show BadPrf where | ||
show Ok = "Ok" | ||
show (No prf) = absurd $ bad prf | ||
|
||
main : IO () | ||
main = printLn Ok |
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 @@ | ||
%noinline | ||
foo : (0 _ : Z = S Z) -> Void | ||
foo _ impossible | ||
|
||
%noinline | ||
bah : (0 _ : Z = S Z) -> Void | ||
bah prf = foo prf | ||
data BadPrf = Ok | No (Z = S Z) | ||
|
||
Show BadPrf where | ||
show Ok = "Ok" | ||
show (No prf) = absurd $ bah prf | ||
|
||
main : IO () | ||
main = printLn Ok |
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,9 @@ | ||
import System | ||
partial | ||
unreachable : a | ||
unreachable = idris_crash "unreachable" | ||
|
||
main : IO Int | ||
main = do | ||
exitSuccess | ||
assert_total unreachable |
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,2 @@ | ||
Ok | ||
Ok |
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,5 @@ | ||
$1 --no-banner --no-color --console-width 0 --exec main Crash.idr | ||
$1 --no-banner --no-color --console-width 0 --exec main Crash2.idr | ||
$1 --no-banner --no-color --console-width 0 --exec main Crash3.idr | ||
|
||
rm -rf build |