Skip to content

Commit 8eac9a9

Browse files
committed
Only wrap string call in try/catch
1 parent 1f2fcb4 commit 8eac9a9

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/transform/common.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,16 +72,17 @@ function rewrite_debuginfo!(ir::IRCode)
7272
for (i, stmt) in enumerate(ir.stmts)
7373
type = stmt[:type]
7474
annotation = type === nothing ? "" : " (inferred type: $type)"
75-
# Work around showing functions requiring `invokelatest` queries
76-
# that are problematic to execute from generated functions.
77-
local filename
75+
# Work around `show` functions requiring `invokelatest` queries
76+
# that may be problematic to execute from within generated functions.
77+
local inst
7878
try
79-
filename = Symbol("%$i = $(stmt[:inst])", annotation)
79+
inst = string(stmt[:inst])
8080
catch e
8181
isa(e, UndefVarError) && continue
8282
rethrow()
8383
end
84-
lineno = LineNumberNode(1, filename::Symbol)
84+
filename = Symbol("%$i = $inst", annotation)
85+
lineno = LineNumberNode(1, filename)
8586
stmt[:line] = insert_debuginfo!(ir.debuginfo, i, lineno, stmt[:line])
8687
end
8788
end

0 commit comments

Comments
 (0)