From ad769cfc78bea044ac4b2f19fe5a0ed79fc423a5 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Sat, 16 Mar 2024 00:43:43 -0700 Subject: Fix C23 empty initializers These should should act as zero initializers, but since init==NULL was used to mean both "no initializer" and "empty initializer", empty initializers weren't zero-initializing the variable. --- test/initializer-empty-struct.qbe | 3 +++ test/initializer-empty.qbe | 1 + 2 files changed, 4 insertions(+) (limited to 'test') diff --git a/test/initializer-empty-struct.qbe b/test/initializer-empty-struct.qbe index 9bbfb34..400f504 100644 --- a/test/initializer-empty-struct.qbe +++ b/test/initializer-empty-struct.qbe @@ -4,5 +4,8 @@ function $f() { @start.1 %.1 =l alloc8 16 @body.2 + storel 0, %.1 + %.2 =l add %.1, 8 + storel 0, %.2 ret } diff --git a/test/initializer-empty.qbe b/test/initializer-empty.qbe index 2ed8249..f3358bd 100644 --- a/test/initializer-empty.qbe +++ b/test/initializer-empty.qbe @@ -4,5 +4,6 @@ function $f() { @start.1 %.1 =l alloc4 4 @body.2 + storew 0, %.1 ret } -- cgit v1.2.3