Skip to content

Commit

Permalink
avoid a possible out of bounds access in inlineable
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffBezanson committed Jun 15, 2016
1 parent 923d575 commit d6b80d2
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 @@ -2333,7 +2333,7 @@ function inlineable(f::ANY, ft::ANY, e::Expr, atypes::Vector{Any}, sv::Inference
if (is(f,apply_type) || is(f,fieldtype) || is(f,typeof) ||
istopfunction(topmod, f, :typejoin) ||
istopfunction(topmod, f, :promote_type))
if effect_free(argexprs[2], sv, true)
if length(argexprs) < 2 || effect_free(argexprs[2], sv, true)
return (e.typ.parameters[1],())
else
return (e.typ.parameters[1], Any[argexprs[2]])
Expand Down

0 comments on commit d6b80d2

Please sign in to comment.