Skip to content

Commit

Permalink
assume getfield is non-volatile if inferred to be constant
Browse files Browse the repository at this point in the history
fixes regression caused by JuliaLang#18017
  • Loading branch information
JeffBezanson authored and mfasi committed Sep 5, 2016
1 parent 81b9e9f commit ae4b42f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2258,7 +2258,7 @@ function effect_free(e::ANY, linfo::LambdaInfo, allow_volatile::Bool)
if !allow_volatile
if is_known_call(e, arrayref, linfo) || is_known_call(e, arraylen, linfo)
return false
elseif is_known_call(e, getfield, linfo)
elseif is_known_call(e, getfield, linfo) && !isa(exprtype(e,linfo), Const)
# first argument must be immutable to ensure e is affect_free
a = ea[2]
typ = widenconst(exprtype(a, linfo))
Expand Down

0 comments on commit ae4b42f

Please sign in to comment.