forked from JuliaLang/julia
-
Notifications
You must be signed in to change notification settings - Fork 1
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!
(JuliaLang#43603)
In a similar spirit to JuliaLang#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
1 parent
52b86d8
commit b299c9a
Showing
2 changed files
with
180 additions
and
11 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