From d7714eeca76f953a1efb4d2038dac29d3c1a850a Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Mon, 25 Sep 2023 13:51:07 +0900 Subject: [PATCH] [qfcc] Disable VM evaluation for non-ruamoko targets This is really a bandaid for the problem of ruamoko not being an actual superset of v6 progs (eg, no float | operation). With this, even ctf builds. --- tools/qfcc/source/constfold.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/qfcc/source/constfold.c b/tools/qfcc/source/constfold.c index 860235700..657343b03 100644 --- a/tools/qfcc/source/constfold.c +++ b/tools/qfcc/source/constfold.c @@ -1709,7 +1709,8 @@ fold_constants (expr_t *e) if (!e1) { return e; } - if (is_math (get_type (e1))) { + if (options.code.progsversion == PROG_VERSION + && is_math (get_type (e1))) { return evaluate_constexpr (e); } op = e->expr.op; @@ -1726,7 +1727,8 @@ fold_constants (expr_t *e) return e; } - if (is_math_val (e1) && is_math_val (e2)) { + if (options.code.progsversion == PROG_VERSION + && is_math_val (e1) && is_math_val (e2)) { return evaluate_constexpr (e); }