# HG changeset patch # User Shinji KONO # Date 1396319329 -32400 # Node ID 662e2b778fc25c5c86d8fb5420b16390bc869ae4 # Parent e3de6b70abe93e15972fb64d6815d42e494dbcbe handle extra arguments for externed struct returning function. diff -r e3de6b70abe9 -r 662e2b778fc2 mc-codegen.c --- 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; diff -r e3de6b70abe9 -r 662e2b778fc2 mc-parse.c --- a/mc-parse.c Tue Apr 01 09:47:38 2014 +0900 +++ b/mc-parse.c Tue Apr 01 11:28:49 2014 +0900 @@ -1575,6 +1575,7 @@ offset = list4(CAST,offset,t,type); } else { int mode_save = mode; + mode=STAT; int e=expr1(); mode = mode_save; if (inmode) {