From d6b80d27a6189e805f7a27dc609a85169c14f578 Mon Sep 17 00:00:00 2001 From: Jeff Bezanson Date: Mon, 25 Apr 2016 14:04:04 -0400 Subject: [PATCH] avoid a possible out of bounds access in `inlineable` --- base/inference.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/base/inference.jl b/base/inference.jl index 2568cb3d2fecf..063354001a72d 100644 --- a/base/inference.jl +++ b/base/inference.jl @@ -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]])