Skip to content

Commit

Permalink
Fix dangling reference produced by temporary passed to TestFileParser…
Browse files Browse the repository at this point in the history
… going out of scope

- This fixes the `stack-use-after-scope` error reported by asan.
  • Loading branch information
cameel committed May 19, 2021
1 parent 752483b commit d85cc6c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/libsolidity/util/TestFileParserTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ namespace

vector<FunctionCall> parse(string const& _source)
{
static std::map<std::string, Builtin> const builtins = {};

istringstream stream{_source, ios_base::out};
return TestFileParser{stream, {}}.parseFunctionCalls(0);
return TestFileParser{stream, builtins}.parseFunctionCalls(0);
}

void testFunctionCall(
Expand Down

0 comments on commit d85cc6c

Please sign in to comment.