Skip to content

Commit

Permalink
fixup! Add semantic tests for duplicated function definitions with sa…
Browse files Browse the repository at this point in the history
…me function id in internal dispatcher
  • Loading branch information
cameel committed Sep 26, 2023
1 parent 6deb2a3 commit ca75a35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libsolidity/codegen/ir/IRGenerationContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,13 @@ InternalDispatchMap IRGenerationContext::consumeInternalDispatchMap()
void IRGenerationContext::addToInternalDispatch(FunctionDefinition const& _function)
{
FunctionType const* functionType = TypeProvider::function(_function, FunctionType::Kind::Internal);
solAssert(functionType, "");
solAssert(functionType);

YulArity arity = YulArity::fromType(*functionType);
auto it = ranges::find(m_internalDispatchMap[arity], &_function);
if (it == ranges::end(m_internalDispatchMap[arity]))
DispatchQueue& dispatchQueue = m_internalDispatchMap[arity];
if (ranges::find(dispatchQueue, &_function) == ranges::end(dispatchQueue))
{
m_internalDispatchMap[arity].push_back(&_function);
dispatchQueue.push_back(&_function);
enqueueFunctionForCodeGeneration(_function);
}
}
Expand Down

0 comments on commit ca75a35

Please sign in to comment.