From d0e2f289b2052cb7f611469dfc310f52c0a4a8ed Mon Sep 17 00:00:00 2001 From: Sebastian Pfitzner Date: Mon, 11 May 2020 15:45:42 +0200 Subject: [PATCH 1/2] fix line numbers --- src/analysis.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/analysis.jl b/src/analysis.jl index 2b6e9b6..10303a3 100644 --- a/src/analysis.jl +++ b/src/analysis.jl @@ -22,7 +22,7 @@ method(c::DynamicCall) = which(c.f, argtypes(c)) method_expr(c::DynamicCall) = method_expr(c.f, argtypes(c)) function code(c::DynamicCall; optimize = false) - codeinfo = code_typed(c.f, argtypes(c), optimize = optimize) + codeinfo = code_typed(c.f, argtypes(c), optimize = optimize, debuginfo=:source) @assert length(codeinfo) == 1 codeinfo = codeinfo[1] return codeinfo From 26dab428e4eeb7f69df6fbbe5ffa79674969c8e8 Mon Sep 17 00:00:00 2001 From: Sebastian Pfitzner Date: Mon, 11 May 2020 16:58:51 +0200 Subject: [PATCH 2/2] fix for Julia 1.0 --- src/analysis.jl | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/analysis.jl b/src/analysis.jl index 10303a3..576234c 100644 --- a/src/analysis.jl +++ b/src/analysis.jl @@ -22,7 +22,11 @@ method(c::DynamicCall) = which(c.f, argtypes(c)) method_expr(c::DynamicCall) = method_expr(c.f, argtypes(c)) function code(c::DynamicCall; optimize = false) - codeinfo = code_typed(c.f, argtypes(c), optimize = optimize, debuginfo=:source) + codeinfo = @static if VERSION >= v"1.1.0" + code_typed(c.f, argtypes(c), optimize = optimize, debuginfo=:source) + else + code_typed(c.f, argtypes(c), optimize = optimize) + end @assert length(codeinfo) == 1 codeinfo = codeinfo[1] return codeinfo