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 23, 2016
1 parent 3e17c50 commit 753b4ca
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 @@ -2723,20 +2723,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) && stmt.head === :line) || 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).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 753b4ca

Please sign in to comment.