Selaa lähdekoodia

Fixed newexpr struct instance code generation. Fixes #326.

woollybah 7 vuotta sitten
vanhempi
commit
fc0726154a
1 muutettua tiedostoa jossa 5 lisäystä ja 1 poistoa
  1. 5 1
      ctranslator.bmx

+ 5 - 1
ctranslator.bmx

@@ -1605,7 +1605,11 @@ t:+"NULLNULLNULL"
 			End If
 			End If
 
 
 			If expr.instanceExpr Then
 			If expr.instanceExpr Then
-				t = "_" + ctorMunged + "_ObjectNew" + TransArgs( expr.args,expr.ctor, Bra(expr.instanceExpr.Trans()) + "->clas" )
+				If expr.classDEcl.IsStruct() Then
+					t = ctorMunged + "_ObjectNew" + TransArgs( expr.args,expr.ctor)
+				Else
+					t = "_" + ctorMunged + "_ObjectNew" + TransArgs( expr.args,expr.ctor, Bra(expr.instanceExpr.Trans()) + "->clas" )
+				End If
 			Else
 			Else
 				If ClassHasObjectField(expr.classDecl) And Not expr.classDecl.IsStruct() Then
 				If ClassHasObjectField(expr.classDecl) And Not expr.classDecl.IsStruct() Then
 					t = "_" + ctorMunged + "_ObjectNew" + TransArgs( expr.args,expr.ctor, "&" + expr.classDecl.actual.munged )
 					t = "_" + ctorMunged + "_ObjectNew" + TransArgs( expr.args,expr.ctor, "&" + expr.classDecl.actual.munged )