diff --git a/src/validator_impl.cc b/src/validator_impl.cc index 006ac7a597..88a1950661 100644 --- a/src/validator_impl.cc +++ b/src/validator_impl.cc @@ -84,16 +84,14 @@ bool ValidatorImpl::ValidateEntryPoints(const ast::EntryPointList& eps) { entry_point_map.push_scope(); for (const auto& ep : eps) { auto* ep_ptr = ep.get(); - if (!function_stack_.has(ep_ptr->function_name())) { + ast::Function* func = nullptr; + if (!function_stack_.get(ep_ptr->function_name(), &func)) { set_error(ep_ptr->source(), "v-0019: Function used in entry point does not exist: '" + ep_ptr->function_name() + "'"); return false; } - ast::Function* func = nullptr; - function_stack_.get(ep_ptr->function_name(), &func); - if (!func->return_type()->IsVoid()) { set_error(ep_ptr->source(), "v-0024: Entry point function must return void: '" +