|
@@ -569,14 +569,18 @@ Type TCTranslator Extends TTranslator
|
|
InternalErr "TCTranslator.TransValue"
|
|
InternalErr "TCTranslator.TransValue"
|
|
End Method
|
|
End Method
|
|
|
|
|
|
- Method TransArgs$( args:TExpr[],decl:TFuncDecl, objParam:String = Null )
|
|
|
|
|
|
+ Method TransArgs$( args:TExpr[],decl:TFuncDecl, objParam:String = Null, objectNew:Int = False )
|
|
'If decl.ident="AddS" DebugStop
|
|
'If decl.ident="AddS" DebugStop
|
|
|
|
|
|
Local t$
|
|
Local t$
|
|
If objParam And (decl.IsMethod() Or decl.isCtor()) And ((Not decl.IsExtern()) Or (decl.IsExtern() And TClassDecl(decl.scope) And Not TClassDecl(decl.scope).IsStruct())) Then
|
|
If objParam And (decl.IsMethod() Or decl.isCtor()) And ((Not decl.IsExtern()) Or (decl.IsExtern() And TClassDecl(decl.scope) And Not TClassDecl(decl.scope).IsStruct())) Then
|
|
' object cast to match param type
|
|
' object cast to match param type
|
|
- If TClassDecl(decl.scope) Then
|
|
|
|
- t :+ Bra(TransObject(TClassDecl(decl.scope).GetLatestFuncDecl(decl).scope, TClassDecl(decl.scope).IsStruct()))
|
|
|
|
|
|
+ If objectNew Then
|
|
|
|
+ t :+ Bra("BBClass *")
|
|
|
|
+ Else
|
|
|
|
+ If TClassDecl(decl.scope) Then
|
|
|
|
+ t :+ Bra(TransObject(TClassDecl(decl.scope).GetLatestFuncDecl(decl).scope, TClassDecl(decl.scope).IsStruct()))
|
|
|
|
+ End If
|
|
End If
|
|
End If
|
|
t:+ objParam
|
|
t:+ objParam
|
|
End If
|
|
End If
|
|
@@ -1850,12 +1854,12 @@ t:+"NULLNULLNULL"
|
|
End If
|
|
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, True )
|
|
Else
|
|
Else
|
|
If expr.classDecl.IsStruct() Then
|
|
If expr.classDecl.IsStruct() Then
|
|
t = ctorMunged + "_ObjectNew" + TransArgs( expr.args,expr.ctor)
|
|
t = ctorMunged + "_ObjectNew" + TransArgs( expr.args,expr.ctor)
|
|
Else
|
|
Else
|
|
- t = "_" + ctorMunged + "_ObjectNew" + TransArgs( expr.args,expr.ctor, "&" + expr.classDecl.actual.munged)
|
|
|
|
|
|
+ t = "_" + ctorMunged + "_ObjectNew" + TransArgs( expr.args,expr.ctor, "&" + expr.classDecl.actual.munged, True)
|
|
End If
|
|
End If
|
|
End If
|
|
End If
|
|
End If
|
|
End If
|