Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record correct assignment line (fixes #399) #401

Merged
merged 1 commit into from
Nov 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Record correct assignment line (fixes #399)
timholy committed Nov 30, 2019
commit 2bdcd1f21b123d90032ae4f8c3433a7f0d02d5b8
2 changes: 1 addition & 1 deletion src/backedges.jl
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@ mutable struct SlotDep
end
function SlotDep(i::Int, stmt, slotdeps)
deps = add_deps!(Int[], stmt, slotdeps)
SlotDep(isssa(stmt) ? 0 : i, deps)
SlotDep(i, deps)
end
function add_deps!(linedeps, stmt, slotdeps)
if isssa(stmt)
28 changes: 28 additions & 0 deletions test/backedges.jl
Original file line number Diff line number Diff line change
@@ -30,4 +30,32 @@ end
@test !isdefined(BackEdgesTest, :planetdiameters)
@test length(Revise.moduledeps[BackEdgesTest]) == 1
@test Revise.moduledeps[BackEdgesTest][:flag] == Set([(BackEdgesTest, first(Iterators.drop(mexs[BackEdgesTest], 1))[1])])

# issue #399
src = """
for jy in ("j","y"), nu in (0,1)
jynu = Expr(:quote, Symbol(jy,nu))
jynuf = Expr(:quote, Symbol(jy,nu,"f"))
bjynu = Symbol("bessel",jy,nu)
if jy == "y"
@eval begin
\$bjynu(x::Float64) = nan_dom_err(ccall((\$jynu,libm), Float64, (Float64,), x), x)
\$bjynu(x::Float32) = nan_dom_err(ccall((\$jynuf,libm), Float32, (Float32,), x), x)
\$bjynu(x::Float16) = Float16(\$bjynu(Float32(x)))
end
else
@eval begin
\$bjynu(x::Float64) = ccall((\$jynu,libm), Float64, (Float64,), x)
\$bjynu(x::Float32) = ccall((\$jynuf,libm), Float32, (Float32,), x)
\$bjynu(x::Float16) = Float16(\$bjynu(Float32(x)))
end
end
@eval begin
\$bjynu(x::Real) = \$bjynu(float(x))
\$bjynu(x::Complex) = \$(Symbol("bessel",jy))(\$nu,x)
end
end
"""
ex = Meta.parse(src)
@test Revise.methods_by_execution(BackEdgesTest, ex) isa Tuple
end