Ecere Software
/
sdk
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fa0e471
)
compiler/libec: Null checks
author
Jerome St-Louis
<jerome@ecere.com>
Tue, 16 Jun 2015 08:23:42 +0000
(
04:23
-0400)
committer
Jerome St-Louis
<jerome@ecere.com>
Tue, 16 Jun 2015 08:23:42 +0000
(
04:23
-0400)
compiler/libec/src/pass0.ec
patch
|
blob
|
history
compiler/libec/src/pass1.ec
patch
|
blob
|
history
compiler/libec/src/pass2.ec
patch
|
blob
|
history
compiler/libec/src/pass3.ec
patch
|
blob
|
history
diff --git
a/compiler/libec/src/pass0.ec
b/compiler/libec/src/pass0.ec
index
3a18141
..
1496fe8
100644
(file)
--- a/
compiler/libec/src/pass0.ec
+++ b/
compiler/libec/src/pass0.ec
@@
-428,7
+428,7
@@
static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
classType = regClass.type;
// PUBLISHING CHECK ON BASE CLASS
classType = regClass.type;
// PUBLISHING CHECK ON BASE CLASS
- if(inCompiler
)
+ if(inCompiler
&& regClass.base) // The base check saves a crash trying to inherit from itself
{
yylloc = loc;
{
yylloc = loc;
diff --git
a/compiler/libec/src/pass1.ec
b/compiler/libec/src/pass1.ec
index
0370d4a
..
7c0f957
100644
(file)
--- a/
compiler/libec/src/pass1.ec
+++ b/
compiler/libec/src/pass1.ec
@@
-1510,7
+1510,7
@@
static void ProcessClass(ClassType classType, OldList definitions, Symbol symbol
// int64 value
{
char * temp;
// int64 value
{
char * temp;
- if(
!strcmp(regClass.dataTypeString, "uint64"))
+ if(
regClass.dataTypeString && !strcmp(regClass.dataTypeString, "uint64")) // regClass.dataTypeString was null for TokenType in 'enum TokenType : ExpOperator'
temp = PrintUInt64(value.data);
else
temp = PrintInt64(value.data);
temp = PrintUInt64(value.data);
else
temp = PrintInt64(value.data);
diff --git
a/compiler/libec/src/pass2.ec
b/compiler/libec/src/pass2.ec
index
f836a5f
..
b8b1ad9
100644
(file)
--- a/
compiler/libec/src/pass2.ec
+++ b/
compiler/libec/src/pass2.ec
@@
-3197,9
+3197,12
@@
static void ProcessExpression(Expression exp)
if(!e.next && exp.usage.usageGet) e.usage.usageGet = true;
ProcessExpression(e);
}
if(!e.next && exp.usage.usageGet) e.usage.usageGet = true;
ProcessExpression(e);
}
- if(exp.usage.usageGet)
- exp.cond.elseExp.usage.usageGet = true;
- ProcessExpression(exp.cond.elseExp);
+ if(exp.cond.elseExp)
+ {
+ if(exp.usage.usageGet)
+ exp.cond.elseExp.usage.usageGet = true;
+ ProcessExpression(exp.cond.elseExp);
+ }
break;
}
case classExp:
break;
}
case classExp:
diff --git
a/compiler/libec/src/pass3.ec
b/compiler/libec/src/pass3.ec
index
978888f
..
d5d3e0e
100644
(file)
--- a/
compiler/libec/src/pass3.ec
+++ b/
compiler/libec/src/pass3.ec
@@
-674,7
+674,8
@@
static void InstDeclPassExpression(Expression exp)
InstDeclPassExpression(exp.cond.cond);
for(e = exp.cond.exp->first; e; e = e.next)
InstDeclPassExpression(e);
InstDeclPassExpression(exp.cond.cond);
for(e = exp.cond.exp->first; e; e = e.next)
InstDeclPassExpression(e);
- InstDeclPassExpression(exp.cond.elseExp);
+ if(exp.cond.elseExp)
+ InstDeclPassExpression(exp.cond.elseExp);
break;
}
case extensionCompoundExp:
break;
}
case extensionCompoundExp: