]> git.sur5r.net Git - cc65/blobdiff - src/ca65/pseudo.c
Improve the assertion check
[cc65] / src / ca65 / pseudo.c
index 2522e54c8f945a46f2ebb2f14c9b5012f625e51a..3a9caac6d83b14cccdb40abe46e668f91fe56eae 100644 (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 ();