commit 75e2d6ceff7bb7453a88eb26e6f3156040a1a6f4
parent a2b893c3822002a81cfc24d286dbe3971ea163e3
Author: Ryan Sepassi <rsepassi@gmail.com>
Date: Mon, 18 May 2026 17:44:45 -0700
Fix zero-fill static object emission
Diffstat:
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lang/c/parse/parse_init.c b/lang/c/parse/parse_init.c
@@ -808,7 +808,8 @@ void define_static_object(Parser* p, ObjSymId sym, ObjSecId section_id,
}
cfree_cg_data_begin(p->cg, sym, attrs);
- emit_static_data(p, buf, size);
+ emit_static_data(p, (attrs.flags & CFREE_CG_DATADEF_ZERO_FILL) ? NULL : buf,
+ size);
cfree_cg_data_end(p->cg);
p->static_relocs_len = 0;
(void)loc;
diff --git a/test/parse/cases/6_7_9_02_static_ptr_null_read.skip b/test/parse/cases/6_7_9_02_static_ptr_null_read.skip
@@ -1 +0,0 @@
-red: reading a file-scope pointer object initialized from NULL crashes the JIT path