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 #18017
  • Loading branch information
JeffBezanson committed Aug 16, 2016
1 parent bf2c29f commit e35a7f6
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 @@ -2257,7 +2257,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 e35a7f6

Please sign in to comment.