From d85cc6c06a922d65c7a152950d98895131ab19c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Wed, 19 May 2021 23:27:30 +0200 Subject: [PATCH] Fix dangling reference produced by temporary passed to TestFileParser going out of scope - This fixes the `stack-use-after-scope` error reported by asan. --- test/libsolidity/util/TestFileParserTests.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/libsolidity/util/TestFileParserTests.cpp b/test/libsolidity/util/TestFileParserTests.cpp index 8ef7fbf2ca9d..0a412b3030d8 100644 --- a/test/libsolidity/util/TestFileParserTests.cpp +++ b/test/libsolidity/util/TestFileParserTests.cpp @@ -44,8 +44,10 @@ namespace vector parse(string const& _source) { + static std::map const builtins = {}; + istringstream stream{_source, ios_base::out}; - return TestFileParser{stream, {}}.parseFunctionCalls(0); + return TestFileParser{stream, builtins}.parseFunctionCalls(0); } void testFunctionCall(