commit cf41f8945f1af8e02d5239172f65115584a796bd
parent 0bd9f47f650e1c9e01a151bf2f2d1e633543d9a3
Author: Drew DeVault <sir@cmpwn.com>
Date: Sun, 2 May 2021 13:58:02 -0400
Revert "eval_cast: fix float -> integer casts"
This reverts commit 0bd9f47f650e1c9e01a151bf2f2d1e633543d9a3.
Diffstat:
1 file changed, 1 insertion(+), 9 deletions(-)
diff --git a/src/eval.c b/src/eval.c
@@ -414,15 +414,7 @@ eval_cast(struct context *ctx, struct expression *in, struct expression *out)
case STORAGE_UINTPTR:
case STORAGE_SIZE:
case STORAGE_RUNE:
- if (type_is_float(val.result)) {
- out->constant.ival =
- itrunc(to, (intmax_t)val.constant.fval);
- } else if (type_is_signed(val.result)) {
- out->constant.ival = itrunc(to, val.constant.ival);
- } else {
- assert(type_is_integer(val.result));
- out->constant.ival = itrunc(to, val.constant.uval);
- }
+ out->constant.uval = itrunc(to, val.constant.uval);
return EVAL_OK;
case STORAGE_ARRAY:
case STORAGE_SLICE: