Skip to content

Commit

Permalink
Merge pull request #3327 from 9rnsr/fix_error
Browse files Browse the repository at this point in the history
More error propagation
  • Loading branch information
yebblies committed Feb 23, 2014
2 parents ae31aa5 + 72cab99 commit 6be4420
Show file tree
Hide file tree
Showing 6 changed files with 213 additions and 115 deletions.
10 changes: 5 additions & 5 deletions src/cast.c
Expand Up @@ -2850,6 +2850,7 @@ int typeMerge(Scope *sc, Expression *e, Type **pt, Expression **pe1, Expression

/************************************
* Bring leaves to common type.
* Returns ErrorExp if error occurs. otherwise returns NULL.
*/

Expression *typeCombine(BinExp *be, Scope *sc)
Expand All @@ -2875,13 +2876,12 @@ Expression *typeCombine(BinExp *be, Scope *sc)
return be->e1;
if (be->e2->op == TOKerror)
return be->e2;
return be;
return NULL;

Lerror:
be->incompatibleTypes();
be->type = Type::terror;
be->e1 = new ErrorExp();
be->e2 = new ErrorExp();
Expression *ex = be->incompatibleTypes();
if (ex->op == TOKerror)
return ex;
return new ErrorExp();
}

Expand Down

0 comments on commit 6be4420

Please sign in to comment.