-
-
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.
effects: handle va-method properly when refining `:inaccessiblememonl…
…y` (#48854) Previously the `:inaccessiblememonly` effect bit may be wrongly refined when analyzing va-method, e.g.: ```julia julia> callgetfield1(xs...) = getfield(getfield(xs, 1), 1) callgetfield1 (generic function with 1 method) julia> Base.infer_effects(callgetfield1, (Base.RefValue{Symbol},)) (+c,+e,!n,+t,+s,+m,+i) # inaccessiblememonly is wrongly refined here ``` This leads to wrong concrete evaluation of `callgetfield1` and thus may result in a problem like below: ```julia julia> const GLOBAL_XS = Ref(:julia); julia> global_getfield() = callgetfield1(GLOBAL_XS); julia> @test let Base.Experimental.@force_compile global_getfield() end === :julia Test Passed julia> GLOBAL_XS[] = :julia2; julia> @test let Base.Experimental.@force_compile global_getfield() end === :julia2 # this fails Test Failed at REPL[8]:1 Expression: let #= REPL[8]:2 =# Base.Experimental.@force_compile global_getfield() end === :julia2 Evaluated: julia === julia2 ``` This commit fixes it up.
- Loading branch information
Showing
4 changed files
with
22 additions
and
5 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
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