Skip to content

Commit

Permalink
Merge pull request #62 from JuliaDebug/sp/fix-foreign-task-logic
Browse files Browse the repository at this point in the history
Fix foreign task detection logic
  • Loading branch information
pfitzseb authored Jan 26, 2022
2 parents 5243448 + bdeaab8 commit ffdc723
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Infiltrator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ function start_prompt(mod, locals, file, fileline;
length(trace))
trace = trace[start:last]

if CHECK_TASK[] && current_task() != CURRENT_EVAL_TASK[]
if CHECK_TASK[] && CURRENT_EVAL_TASK[] !== nothing && current_task() != CURRENT_EVAL_TASK[]
if length(trace) > 0
println(io, "Cannot infiltrate foreign tasks. Disabling infiltration point at $(trace[1]).")
else
Expand Down Expand Up @@ -497,8 +497,9 @@ end
function ast_transformer(sym)
return function (ex)
return quote
$(@__MODULE__).CURRENT_EVAL_TASK[] = current_task()
let $(sym) = $(ex)
$(@__MODULE__).CURRENT_EVAL_TASK[] = current_task()
$(@__MODULE__).CURRENT_EVAL_TASK[] = nothing
$(@__MODULE__).end_session!()
$(sym)
end
Expand Down

0 comments on commit ffdc723

Please sign in to comment.