From ac876d8c2ea01e0383709a8a045c3e592c9564eb Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 11 Apr 2022 14:22:25 +0300 Subject: [PATCH] Refactor function call argument type resolving logic a bit --- source/glsl/resolve.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/glsl/resolve.cpp b/source/glsl/resolve.cpp index 115624c4..82c0a367 100644 --- a/source/glsl/resolve.cpp +++ b/source/glsl/resolve.cpp @@ -1089,6 +1089,11 @@ void ExpressionResolver::visit(FunctionCall &call) { TypeDeclaration *arg_type = call.arguments[i]->type; TypeDeclaration *param_type = call.declaration->parameters[i]->type_declaration; + if(arg_type==param_type) + continue; + else if(!arg_type || !param_type) + return; + BasicTypeDeclaration *arg_basic = dynamic_cast(arg_type); BasicTypeDeclaration *param_basic = dynamic_cast(param_type); if(arg_basic && param_basic) @@ -1097,8 +1102,6 @@ void ExpressionResolver::visit(FunctionCall &call) if(compat==RIGHT_CONVERTIBLE) convert_to(call.arguments[i], *param_basic); } - else if(!arg_type || !param_type || arg_type!=param_type) - return; } resolve(call, call.declaration->return_type_declaration, false); } -- 2.45.2