diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc index 7036df957..5ddbac634 100644 --- a/src/libexpr/eval.cc +++ b/src/libexpr/eval.cc @@ -1113,6 +1113,7 @@ void EvalState::resetFileCache() importResolutionCache->clear(); fileEvalCache->clear(); inputCache->clear(); + positions.clear(); } void EvalState::eval(Expr * e, Value & v) diff --git a/src/libutil/include/nix/util/pos-table.hh b/src/libutil/include/nix/util/pos-table.hh index d944b1353..c5f93a3d5 100644 --- a/src/libutil/include/nix/util/pos-table.hh +++ b/src/libutil/include/nix/util/pos-table.hh @@ -111,6 +111,16 @@ public: return o->origin; return std::monostate{}; } + + /** + * Remove all origins from the table. + */ + void clear() + { + auto lines = linesCache.lock(); + lines->clear(); + origins.clear(); + } }; } // namespace nix