changeset 881:ab501cdbbefd

fix wrong src/dst type in pdecl_data_field
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 03 Apr 2014 17:49:05 +0900
parents 5313ed059cee
children 3976dc54ec3d
files mc-codegen.c mc-inline.c mc-parse.c
diffstat 3 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mc-codegen.c	Thu Apr 03 10:43:01 2014 +0900
+++ b/mc-codegen.c	Thu Apr 03 17:49:05 2014 +0900
@@ -3969,7 +3969,6 @@
     int v0 = car(v);
     NMTBL *n = ncaddr(v);
 
-    if (inmode) error(-1);
 #if STRUCT_ALIGN
     if (t!=EMPTY) 
         offset = struct_align_offset(t,offset);
--- a/mc-inline.c	Thu Apr 03 10:43:01 2014 +0900
+++ b/mc-inline.c	Thu Apr 03 17:49:05 2014 +0900
@@ -878,7 +878,7 @@
         if (car(e)!=DECL_DATA) error(-1);
         t = caddr(e);
         decl_str_init=insert_ascend(decl_str_init,
-            glist4(offset+foffset,0,e,glist2(type1,t)),str_init_eq);
+            glist4(offset+foffset,0,e,glist2(t,type1)),str_init_eq);
     }
     return offset;
 }
--- a/mc-parse.c	Thu Apr 03 10:43:01 2014 +0900
+++ b/mc-parse.c	Thu Apr 03 17:49:05 2014 +0900
@@ -1674,7 +1674,6 @@
     // local var init cannot postponed because of assign_expr0/type
     //  if initialization contains expressions,
     //  we cannot do it in STADECL, but we can assign later in this mode
-    if (inmode) error(-1);
     if (local_nptr || mode==SFDINIT)  {
         decl_data_field(type,v,local_struct_offset);
         return;
@@ -1874,7 +1873,7 @@
         conv->lc_(); conv->decl_data_begin_();
         mode = mode_save;
 #if LOCAL_STRUCT_INIT_STATIC 
-        if(mode==LDECL && !inmode) {
+        if(mode==LDECL && !inmode) {   
             local_struct_offset = offset;
             local_struct_static(v); 
             // change mode to STADECL