From 24c59881f565d87579ba31a60ed84a3e414ab2b6 Mon Sep 17 00:00:00 2001 From: Delyan Angelov Date: Tue, 20 Jul 2021 17:13:01 +0300 Subject: [PATCH] v.gen.c: do not use precomputed const values in -usecache mode (fix `v test-all` on M1) --- vlib/v/gen/c/cgen.v | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/vlib/v/gen/c/cgen.v b/vlib/v/gen/c/cgen.v index a99aca8630..33ee3442e9 100644 --- a/vlib/v/gen/c/cgen.v +++ b/vlib/v/gen/c/cgen.v @@ -4905,9 +4905,11 @@ fn (mut g Gen) const_decl(node ast.ConstDecl) { } } else { - if ct_value := field.comptime_expr_value() { - if g.const_decl_precomputed(field.mod, name, ct_value, field.typ) { - continue + if g.pref.build_mode != .build_module { + if ct_value := field.comptime_expr_value() { + if g.const_decl_precomputed(field.mod, name, ct_value, field.typ) { + continue + } } } if field.is_simple_define_const() {