compiler/ecp: Fixed potential null pointer crash
authorJerome St-Louis <jerome@ecere.com>
Wed, 14 May 2014 00:20:22 +0000 (20:20 -0400)
committerJerome St-Louis <jerome@ecere.com>
Wed, 14 May 2014 00:20:22 +0000 (20:20 -0400)
compiler/bootstrap/ecp/bootstrap/ecp.c
compiler/ecp/ecp.ec

index c95b14b..d590bc8 100644 (file)
@@ -1481,10 +1481,12 @@ __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add(&classDefine->classPrope
 }
 else if(def->type == 7)
 {
+if(classDefine)
 classDefine->fixed = 0x1;
 }
 else if(def->type == 6)
 {
+if(classDefine)
 classDefine->noExpansion = 0x1;
 }
 else if(def->type == 13)
index e405fa5..f135411 100644 (file)
@@ -419,11 +419,13 @@ static void AddDefinitions(ClassDefine classDefine, DataMemberDefine parentMembe
          }
          else if(def.type == classFixedClassDef)
          {
-            classDefine.fixed = true;
+            if(classDefine)
+               classDefine.fixed = true;
          }
          else if(def.type == classNoExpansionClassDef)
          {
-            classDefine.noExpansion = true;
+            if(classDefine)
+               classDefine.noExpansion = true;
          }
          else if(def.type == accessOverrideClassDef)
          {