Function types only are compatible if their calling convention is the same, no matter...
authorChristoph Mallon <christoph.mallon@gmx.de>
Mon, 15 Sep 2008 19:25:01 +0000 (19:25 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Mon, 15 Sep 2008 19:25:01 +0000 (19:25 +0000)
[r21983]

type.c

diff --git a/type.c b/type.c
index b05492a..a35aa44 100644 (file)
--- a/type.c
+++ b/type.c
@@ -1025,6 +1025,9 @@ static bool function_types_compatible(const function_type_t *func1,
        if (!types_compatible(ret1, ret2))
                return false;
 
+       if (func1->calling_convention != func2->calling_convention)
+               return false;
+
        /* can parameters be compared? */
        if (func1->unspecified_parameters || func2->unspecified_parameters)
                return true;
@@ -1032,9 +1035,6 @@ static bool function_types_compatible(const function_type_t *func1,
        if (func1->variadic != func2->variadic)
                return false;
 
-       if (func1->calling_convention != func2->calling_convention)
-               return false;
-
        /* TODO: handling of unspecified parameters not correct yet */
 
        /* all argument types must be compatible */