-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inference: add error/throwness checks for
setfield!
In a similar spirit to #43587, this commit introduces error check for `setfield!`. We can bail out from inference if we can prove either of: - the object is not mutable type - the object is `Module` object - the value being assigned is incompatible with the declared type of object field This commit also adds the throwness check for `setfield!` (i.e. `setfield!_nothrow`). This throwness check won't be used in the current native compilation pipeline since `setfield!` call can't be eliminated even if we can prove that it never throws. But this throwness check would be used by EscapeAnalysis.jl integration and so I'd like to include it in Base.
- Loading branch information
Showing
2 changed files
with
145 additions
and
7 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