Skip to content

Commit

Permalink
Merge pull request #44 from julia-vscode/fix-optimization-bug
Browse files Browse the repository at this point in the history
Fix a bug in the swap optimization
  • Loading branch information
davidanthoff authored Jan 6, 2025
2 parents 5d8b3a8 + 83e1d4e commit 813a66b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/default_storage.jl
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,10 @@ function Salsa._memoized_lookup_internal(
# deps are recorded in-place. Note that we must swap them back at the end.
existing_value.dependencies, trace.ordered_deps =
trace.ordered_deps, existing_value.dependencies
# Because we are using the ordered_deps vector from the existing
# value, we need to empty it here, otherwise dependencies from a
# previous invocation of the derived function will hang around
empty!(trace.ordered_deps)
try
v = user_func(runtime, key.args...)
finally
Expand Down

0 comments on commit 813a66b

Please sign in to comment.