commit fc39782822761a78ec6f3e449dba6583ae33909f
parent b815a0d1dc874df2f06ab680b5ceb74413ae4da8
Author: Ember Sawady <ecs@d2evs.net>
Date: Mon, 6 Feb 2023 16:34:19 +0000
itrunc: don't abort on STORAGE_ERROR
Signed-off-by: Ember Sawady <ecs@d2evs.net>
Diffstat:
2 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/eval.c b/src/eval.c
@@ -135,6 +135,7 @@ itrunc(const struct type *type, uintmax_t val)
case STORAGE_ENUM:
return itrunc(type->alias.type, val);
case STORAGE_ERROR:
+ return val;
case STORAGE_F32:
case STORAGE_F64:
case STORAGE_FCONST:
diff --git a/tests/26-regression.ha b/tests/26-regression.ha
@@ -91,4 +91,5 @@ export fn main() void = {
def A: a = a { b = 0 };"
) as rt::exited != rt::EXIT_SUCCESS);
assert(rt::compile("let a = &0;") as rt::exited != rt::EXIT_SUCCESS);
+ assert(rt::compile("def A: a = 1 % 1;") as rt::exited != rt::EXIT_SUCCESS);
};