v.gen.c: do not use precomputed const values in -usecache mode (fix `v test-all` on M1)

pull/10877/head
Delyan Angelov 2021-07-20 17:13:01 +03:00
parent 3f5e3c4bfe
commit 24c59881f5
1 changed files with 5 additions and 3 deletions

View File

@ -4905,9 +4905,11 @@ fn (mut g Gen) const_decl(node ast.ConstDecl) {
} }
} }
else { else {
if ct_value := field.comptime_expr_value() { if g.pref.build_mode != .build_module {
if g.const_decl_precomputed(field.mod, name, ct_value, field.typ) { if ct_value := field.comptime_expr_value() {
continue if g.const_decl_precomputed(field.mod, name, ct_value, field.typ) {
continue
}
} }
} }
if field.is_simple_define_const() { if field.is_simple_define_const() {