diff mc-codegen.c @ 871:662e2b778fc2

handle extra arguments for externed struct returning function.
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Tue, 01 Apr 2014 11:28:49 +0900
parents c005a392e27e
children f93bf97bbd1f
line wrap: on
line diff
--- a/mc-codegen.c	Tue Apr 01 09:47:38 2014 +0900
+++ b/mc-codegen.c	Tue Apr 01 11:28:49 2014 +0900
@@ -3380,6 +3380,12 @@
     if(type0>0&&(car(type0)==FUNCTION || car(type0)==CODE)) {
 	if (mode==GDECL) {
 	    fcheck(n);
+            NMTBL *fsave = fnptr;
+            int save = struct_return;
+            fnptr = n;
+            fdecl_struct(n->ty); /* insert extra argument for struct passing */
+            struct_return = save;
+            fnptr = fsave;
 	    set_ctmode(n,ctmode);
 	    set_attributes(n,attr);
 	    return n;