changeset 382:8b4742a20821

[project @ 2005-09-03 21:07:35 by bellard] fixed function type check
author bellard
date Sat, 03 Sep 2005 21:07:35 +0000
parents f46a6e4e608f
children 7b0992df204d
files tcc.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tcc.c	Sat Sep 03 18:34:22 2005 +0000
+++ b/tcc.c	Sat Sep 03 21:07:35 2005 +0000
@@ -8992,7 +8992,7 @@
 #if 0
             {
                 char buf[500];
-                type_to_str(buf, sizeof(buf), t, get_tok_str(v, NULL));
+                type_to_str(buf, sizeof(buf), &type, get_tok_str(v, NULL));
                 printf("type = '%s'\n", buf);
             }
 #endif
@@ -9007,7 +9007,7 @@
             if (tok == '{') {
                 if (l == VT_LOCAL)
                     error("cannot use local functions");
-                if (!(type.t & VT_FUNC))
+                if ((type.t & VT_BTYPE) != VT_FUNC)
                     expect("function definition");
 
                 /* reject abstract declarators in function definition */