Improve the assertion check

git-svn-id: svn://svn.cc65.org/cc65/trunk@3472 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2005-04-20 09:17:04 +00:00
parent 05ab8714d2
commit 3a22d6c1c3
4 changed files with 61 additions and 32 deletions

View File

@@ -422,29 +422,8 @@ static void DoAssert (void)
return;
}
/* If we can evaluate the assertion now, there's no need to pass it to the
* linker.
*/
if (IsConstExpr (Expr, &Val)) {
/* We can evaluate the expression, so handle it in the assembler */
switch (Action) {
case ASSERT_ACT_WARN:
Warning (0, "%s", SVal);
break;
case ASSERT_ACT_ERROR:
Error ("%s", SVal);
break;
default:
Internal ("Illegal assert action specifier");
break;
}
} else {
/* Cannot evaluate, add it to the object file */
AddAssertion (Expr, Action, GetStringId (SVal));
}
/* Remember the assertion */
AddAssertion (Expr, Action, GetStringId (SVal));
/* Skip the message */
NextTok ();