Fix dangling reference produced by temporary passed to TestFileParser going out of scope

- This fixes the `stack-use-after-scope` error reported by asan.
This commit is contained in:
Kamil Śliwak 2021-05-19 23:27:30 +02:00
parent 752483b92f
commit d85cc6c06a

View File

@ -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(