From 5d8d805b60e98f80bbdf9e8db5067301ab4be064 Mon Sep 17 00:00:00 2001
From: Bill Currie <bill@taniwha.org>
Date: Fri, 14 Feb 2020 20:39:12 +0900
Subject: [PATCH] Fix test for single overload functions

All functions are stored in the overload functions table, even those
that are never explicitly overloaded, but only explicitly overloaded
functions (those with @overload) use the type-qualified naming.
---
 tools/qfcc/source/function.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tools/qfcc/source/function.c b/tools/qfcc/source/function.c
index 9120386b5..bd37d6d05 100644
--- a/tools/qfcc/source/function.c
+++ b/tools/qfcc/source/function.c
@@ -338,9 +338,12 @@ find_function (expr_t *fexpr, expr_t *params)
 		return fexpr;
 	for (func_count = 0; funcs[func_count]; func_count++)
 		;
-	if (func_count < 1) {
-		free (funcs);
-		return fexpr;
+	if (func_count < 2) {
+		f = (overloaded_function_t *) funcs[0];
+		if (func_count && !f->overloaded) {
+			free (funcs);
+			return fexpr;
+		}
 	}
 	type.t.func.type = ((overloaded_function_t *) funcs[0])->type->t.func.type;
 	dummy.type = find_type (&type);