-
-
Notifications
You must be signed in to change notification settings - Fork 415
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix generation of invalid LLVM IR (#4506)
Fix #4475 Before this change, `LLVM` reported an error during module verification when trying to compile the code referenced in issue #4475: ```pony class Foo new create(a: U32) ? => error actor Main new create(env: Env) => try let f = Foo(1)? end ``` This bug was caused by the failure to check for the presence of terminator instructions when generating `ret` instructions. So now, with this change, there's a check for the absence of a terminator instruction each time a `ret` instruction is generated.
- Loading branch information
Showing
13 changed files
with
198 additions
and
95 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
## Fix generation of invalid LLVM IR | ||
|
||
Previously, this code failed at LLVM module verification. Now, with this change, it's fixed by stopping the generation of `ret` instructions after terminator instructions: | ||
|
||
```pony | ||
class Foo | ||
new create(a: U32) ? => | ||
error | ||
actor Main | ||
new create(env: Env) => | ||
try | ||
let f = Foo(1)? | ||
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
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
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
Oops, something went wrong.