From 906f5c1d2d442b1d34621b97950c38c659b729a6 Mon Sep 17 00:00:00 2001 From: Kane York Date: Sun, 9 Aug 2020 22:42:00 -0700 Subject: fix(3p/nix): inherit Expr from gc, make parser state traceable The parser contained vectors, and the primary parser state, that were not participating in GC tracing. Change-Id: Ie198592cd7acffd390e3e2ae9595138b56416838 Reviewed-on: https://cl.tvl.fyi/c/depot/+/1706 Tested-by: BuildkiteCI Reviewed-by: tazjin Reviewed-by: glittershark --- third_party/nix/src/libexpr/parser.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'third_party/nix/src/libexpr/parser.cc') diff --git a/third_party/nix/src/libexpr/parser.cc b/third_party/nix/src/libexpr/parser.cc index a96d345cc126..29d31661c896 100644 --- a/third_party/nix/src/libexpr/parser.cc +++ b/third_party/nix/src/libexpr/parser.cc @@ -92,8 +92,7 @@ void addFormal(const Pos& pos, Formals* formals, const Formal& formal) { formals->argNames.insert(formal.name); } -Expr* stripIndentation(const Pos& pos, SymbolTable& symbols, - std::vector& es) { +Expr* stripIndentation(const Pos& pos, SymbolTable& symbols, VectorExprs& es) { if (es.empty()) { return new ExprString(symbols.Create("")); } @@ -138,11 +137,11 @@ Expr* stripIndentation(const Pos& pos, SymbolTable& symbols, } /* Strip spaces from each line. */ - std::vector* es2 = new std::vector; + VectorExprs* es2 = new VectorExprs; atStartOfLine = true; size_t curDropped = 0; size_t n = es.size(); - for (std::vector::iterator i = es.begin(); i != es.end(); ++i, --n) { + for (VectorExprs::iterator i = es.begin(); i != es.end(); ++i, --n) { ExprIndStr* e = dynamic_cast(*i); if (!e) { atStartOfLine = false; -- cgit 1.4.1