From: Jerome St-Louis Date: Sun, 17 Mar 2013 08:16:30 +0000 (-0400) Subject: compiler/ecere: Proper fix. X-Git-Tag: 0.44.05~2 X-Git-Url: http://ecere.com/cgi-bin/gitweb.cgi?p=sdk;a=commitdiff_plain;h=770896088fd34d3756fa7ccd88ca66d46725c29b compiler/ecere: Proper fix. --- diff --git a/compiler/bootstrap/ecere/bootstrap/instance.c b/compiler/bootstrap/ecere/bootstrap/instance.c index fae4f38..051f60d 100644 --- a/compiler/bootstrap/ecere/bootstrap/instance.c +++ b/compiler/bootstrap/ecere/bootstrap/instance.c @@ -3508,7 +3508,9 @@ if(_class) { { int size = _class->structSize; -int flags = (unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)((struct __ecereNameSpace__ecere__com__Module *)(((char *)_class->module + 12)))->application + 300)))->isGUIApp; +struct __ecereNameSpace__ecere__com__Instance * module = _class->module; +struct __ecereNameSpace__ecere__com__Instance * application = module ? ((struct __ecereNameSpace__ecere__com__Module *)(((char *)module + structSize_Instance)))->application : (((void *)0)); +int flags = application ? (unsigned int)((struct __ecereNameSpace__ecere__com__Application *)(((char *)application + structSize_Module)))->isGUIApp : 0; unsigned int inCompiler = (flags & 8) ? 0x1 : 0x0; if(inCompiler) diff --git a/ecere/src/com/instance.ec b/ecere/src/com/instance.ec index 5fb27e6..5b9e157 100644 --- a/ecere/src/com/instance.ec +++ b/ecere/src/com/instance.ec @@ -4349,7 +4349,9 @@ public dllexport void * eInstance_New(Class _class) #endif { int size = _class.structSize; - int flags = _class.module.application.isGUIApp; + Module module = _class.module; + Application application = module ? module.application : null; + int flags = application ? application.isGUIApp : 0; bool inCompiler = (flags & 8) ? true : false; if(inCompiler) {