compiler/libec: Fixed reference issue with conversion properties
[sdk] / compiler / bootstrap / libec / bootstrap / pass15.c
index e31aad5..940b311 100644 (file)
@@ -182,6 +182,8 @@ extern const char *  sourceFile;
 
 extern struct __ecereNameSpace__ecere__com__Property * __ecereProp_Type_specConst;
 
+unsigned int reachedPass15;
+
 extern unsigned int memoryGuard;
 
 struct __ecereNameSpace__ecere__sys__OldList
@@ -12500,10 +12502,6 @@ if(curSpec)
 curSpec->__anon1.__anon2.definitions = declarations;
 else
 {
-char className[1024];
-
-strcpy(className, "__ecereClass_");
-FullClassNameCat(className, classSym->string, 1);
 specifiers = MkList();
 declarators = MkList();
 ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), declarations));
@@ -12539,6 +12537,18 @@ classSym->__anon2.__anon1.structExternal = external = MkExternalDeclaration((((v
 external->symbol = classSym;
 __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*ast), external);
 }
+if(reachedPass15 && !external->__anon1.declaration && classSym->__anon1.registered && classSym->__anon1.registered->type == 5)
+{
+char structName[1024];
+struct __ecereNameSpace__ecere__sys__OldList * specifiers, * declarators;
+
+structName[0] = 0;
+FullClassNameCat(structName, name, 0);
+specifiers = MkList();
+declarators = MkList();
+ListAdd(specifiers, MkStructOrUnion(3, MkIdentifier(structName), (((void *)0))));
+external->__anon1.declaration = MkDeclaration(specifiers, declarators);
+}
 if(fwdDecl)
 {
 struct External * e = external->fwdDecl ? external->fwdDecl : external;
@@ -15630,6 +15640,7 @@ DeclareFunctionUtil((((void *)0)), "eInstance_IncRef");
 DeclareFunctionUtil((((void *)0)), "eInstance_StopWatching");
 DeclareFunctionUtil((((void *)0)), "eInstance_Watch");
 DeclareFunctionUtil((((void *)0)), "eInstance_FireWatchers");
+reachedPass15 = 1;
 for(external = (*ast).first; external; external = external->next)
 {
 afterExternal = curExternal = external;
@@ -18704,6 +18715,10 @@ __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&exp->expType->__anon1._
 }
 }
 }
+if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->__anon1._class && exp->expType->__anon1._class->__anon1.registered && exp->expType->__anon1._class->__anon1.registered->type == 5 && (!exp->destType || (exp->destType->kind != 3 && exp->destType->kind != 4 && exp->destType->kind != 22 && exp->destType->kind != 23 && exp->destType->kind != 5 && exp->destType->kind != 2 && exp->destType->kind != 1 && exp->destType->kind != 24)))
+{
+exp->byReference = 1;
+}
 yylloc = exp->loc;
 if(exp->destType && (exp->destType->kind == 18))
 ;