Skip to content

Commit

Permalink
Accurate coverage with inlining on
Browse files Browse the repository at this point in the history
Fix #17476
  • Loading branch information
yuyichao committed Aug 27, 2016
1 parent efdbc58 commit df35554
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions base/inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2722,20 +2722,12 @@ function inlineable(f::ANY, ft::ANY, e::Expr, atypes::Vector{Any}, sv::Inference
end
end

if !isempty(stmts)
if all(stmt -> (isa(stmt, Expr) && is_meta_expr(stmt::Expr)) || isa(stmt, LineNumberNode) || stmt === nothing,
stmts)
empty!(stmts)
else
local line::Int = linfo.def.line
if isa(stmts[1], LineNumberNode)
line = shift!(stmts).line
end
unshift!(stmts, Expr(:meta, :push_loc, linfo.def.file, linfo.def.name, line))
isa(stmts[end], LineNumberNode) && pop!(stmts)
push!(stmts, Expr(:meta, :pop_loc))
end
local line::Int = linfo.def.line
if !isempty(stmts) && isa(stmts[1], LineNumberNode)
line = (shift!(stmts)::LineNumberNode).line
end
unshift!(stmts, Expr(:meta, :push_loc, linfo.def.file, linfo.def.name, line))
push!(stmts, Expr(:meta, :pop_loc))
if !isempty(stmts) && !propagate_inbounds
# avoid redundant inbounds annotations
s_1, s_end = stmts[1], stmts[end]
Expand Down

0 comments on commit df35554

Please sign in to comment.