Skip to content

Commit 58bec9f

Browse files
authored
Merge pull request #11371 from ethereum/fix-asan-issue-in-functioncallgraph
Use a local instead of a temporary as an argument to valueOrDefault
2 parents 5e8abec + a0795cb commit 58bec9f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libsolidity/analysis/FunctionCallGraph.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ CallGraph FunctionCallGraphBuilder::buildDeployedGraph(
9696
// All functions present in internal dispatch at creation time could potentially be pointers
9797
// assigned to state variables and as such may be reachable after deployment as well.
9898
builder.m_currentNode = CallGraph::SpecialNode::InternalDispatch;
99-
for (CallGraph::Node const& dispatchTarget: valueOrDefault(_creationGraph.edges, CallGraph::SpecialNode::InternalDispatch, {}))
99+
set<CallGraph::Node, CallGraph::CompareByID> defaultNode;
100+
for (CallGraph::Node const& dispatchTarget: valueOrDefault(_creationGraph.edges, CallGraph::SpecialNode::InternalDispatch, defaultNode))
100101
{
101102
solAssert(!holds_alternative<CallGraph::SpecialNode>(dispatchTarget), "");
102103
solAssert(get<CallableDeclaration const*>(dispatchTarget) != nullptr, "");

0 commit comments

Comments
 (0)