Permalink
Browse files

compiler/libec: Added missing null check to fix IDE crash

  • Loading branch information...
1 parent b3d94f6 commit 452812db78c5ba8f032422070201ee5370405a12 @jerstlouis jerstlouis committed Aug 21, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 compiler/bootstrap/libec/bootstrap/pass15.c
  2. +2 −2 compiler/libec/src/pass15.ec
@@ -14406,7 +14406,7 @@ if(inCompiler)
PrintExpression(exp, expString);
__ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
}
-if(strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec"))
+if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
Compiler_Warning(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "incompatible expression %s (%s); expected %s\n", (((void *)0))), expString, type1, type2);
FreeType(exp->expType);
exp->destType->refCount++;
@@ -10138,8 +10138,8 @@ void ProcessExpressionType(Expression exp)
#ifdef _DEBUG
CheckExpressionType(exp, exp.destType, false);
#endif
- // Flex generates code that triggers this, so we ignore it for a quiet sdk build:
- if(strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec"))
+ // Flex & Bison generate code that triggers this, so we ignore it for a quiet sdk build:
+ if(!sourceFile || (strcmp(sourceFile, "src\\lexer.ec") && strcmp(sourceFile, "src/lexer.ec") && strcmp(sourceFile, "src\\grammar.ec") && strcmp(sourceFile, "src/grammar.ec")))
Compiler_Warning($"incompatible expression %s (%s); expected %s\n", expString, type1, type2);
// TO CHECK: FORCING HERE TO HELP DEBUGGER

0 comments on commit 452812d

Please sign in to comment.