From ca75a354d7455383ee51f149252537fc5eb4ab13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20=C5=9Aliwak?= Date: Tue, 26 Sep 2023 13:42:55 +0200 Subject: [PATCH] fixup! Add semantic tests for duplicated function definitions with same function id in internal dispatcher --- libsolidity/codegen/ir/IRGenerationContext.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libsolidity/codegen/ir/IRGenerationContext.cpp b/libsolidity/codegen/ir/IRGenerationContext.cpp index 4cd362011994..e087dc69a575 100644 --- a/libsolidity/codegen/ir/IRGenerationContext.cpp +++ b/libsolidity/codegen/ir/IRGenerationContext.cpp @@ -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); } }