Skip to content

Commit

Permalink
Merge pull request #14754 from JuliaLang/ob/arraylen-inlining
Browse files Browse the repository at this point in the history
arraylen is not affect-free
  • Loading branch information
vtjnash committed Jan 22, 2016
2 parents 8e036b4 + fcdac63 commit 61bd788
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2223,7 +2223,7 @@ function effect_free(e::ANY, sv, allow_volatile::Bool)
if e.head === :call
if is_known_call_p(e, is_pure_builtin, sv)
if !allow_volatile
if is_known_call(e, arrayref, sv)
if is_known_call(e, arrayref, sv) || is_known_call(e, arraylen, sv)
return false
elseif is_known_call(e, getfield, sv)
# arguments must be immutable to ensure e is affect_free
Expand Down
4 changes: 4 additions & 0 deletions test/core.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3651,3 +3651,7 @@ end
# issue #14691
type T14691; a::UInt; end
@test (T14691(0).a = 0) === 0

# issue #14245
f14245() = (v = []; push!(v, length(v)); v)
@test f14245()[1] == 0

0 comments on commit 61bd788

Please sign in to comment.