function: allow struct * but not struct arguments
authorAlan Cox <alan@linux.intel.com>
Thu, 16 Nov 2017 23:55:49 +0000 (23:55 +0000)
committerAlan Cox <alan@linux.intel.com>
Thu, 16 Nov 2017 23:55:49 +0000 (23:55 +0000)
Applications/SmallC/function.c

index a4f4bd8..1ff456e 100644 (file)
@@ -196,6 +196,10 @@ void doLocalAnsiArgument(int type) {
     if (match("*")) {
         identity = POINTER;
     } else {
+        if (type == STRUCT) {
+            error("cannot pass struct");
+            return;
+        }
         identity = VARIABLE;
         if (type == VOID)
             return;