fix in generating dynamic variable type.
authoryeom <yeom>
Fri, 9 Apr 2010 20:42:27 +0000 (20:42 +0000)
committeryeom <yeom>
Fri, 9 Apr 2010 20:42:27 +0000 (20:42 +0000)
Robust/src/IR/Flat/BuildCode.java

index 1aa30566d2d2bed67dc84daa0829333749b1093f..0f8df47448798559c0b14c8cb3c711b2c5994888 100644 (file)
@@ -2688,9 +2688,20 @@ public class BuildCode {
          } else {
            fmContext = currentSESE.getfmBogus();
          }
+         
+         TypeDescriptor type=dynVar.getType();
+      String typeStr;
+      if( type.isNull() ) {
+            typeStr = "void*";
+      } else if( type.isClass() || type.isArray() ) {
+            typeStr = "struct "+type.getSafeSymbol()+"*";
+      } else {
+            typeStr = type.getSafeSymbol();
+      }
+      
          output.println("       "+generateTemp( fmContext, dynVar, null )+
-                        " = *(("+dynVar.getType()+"*) ("+
-                        dynVar+"_srcSESE + "+dynVar+"_srcOffset));");
+                " = *(("+typeStr+"*) ("+
+                dynVar+"_srcSESE + "+dynVar+"_srcOffset));");
          
          output.println("     }");
          output.println("   }");