@@ -260,37 +260,51 @@ bool ControlFlowBuilder::visit(PlaceholderStatement const&)
260260
261261bool ControlFlowBuilder::visit (FunctionCall const & _functionCall)
262262{
263+ solAssert (!!m_revertNode, " " );
263264 solAssert (!!m_currentNode, " " );
264265 solAssert (!!_functionCall.expression ().annotation ().type , " " );
265266
266267 if (auto functionType = dynamic_cast <FunctionType const *>(_functionCall.expression ().annotation ().type ))
267268 switch (functionType->kind ())
268269 {
269270 case FunctionType::Kind::Revert:
270- solAssert (!!m_revertNode, " " );
271271 visitNode (_functionCall);
272272 _functionCall.expression ().accept (*this );
273273 ASTNode::listAccept (_functionCall.arguments (), *this );
274+
274275 connect (m_currentNode, m_revertNode);
276+
275277 m_currentNode = newLabel ();
276278 return false ;
277279 case FunctionType::Kind::Require:
278280 case FunctionType::Kind::Assert:
279281 {
280- solAssert (!!m_revertNode, " " );
281282 visitNode (_functionCall);
282283 _functionCall.expression ().accept (*this );
283284 ASTNode::listAccept (_functionCall.arguments (), *this );
285+
284286 connect (m_currentNode, m_revertNode);
287+
285288 auto nextNode = newLabel ();
289+
286290 connect (m_currentNode, nextNode);
287291 m_currentNode = nextNode;
288292 return false ;
289293 }
290294 case FunctionType::Kind::Internal:
291295 {
296+ visitNode (_functionCall);
297+ _functionCall.expression ().accept (*this );
298+ ASTNode::listAccept (_functionCall.arguments (), *this );
299+
292300 m_currentNode->functionCalls .emplace_back (&_functionCall);
293- break ;
301+
302+ auto nextNode = newLabel ();
303+
304+ connect (m_currentNode, nextNode);
305+ m_currentNode = nextNode;
306+
307+ return false ;
294308 }
295309 default :
296310 break ;
0 commit comments