aboutsummaryrefslogtreecommitdiff
path: root/src/Module.zig
diff options
context:
space:
mode:
authorJacob Young <jacobly0@users.noreply.github.com>2023-05-29 22:22:05 -0400
committerAndrew Kelley <andrew@ziglang.org>2023-06-10 20:47:57 -0700
commit27f1ad8afde86c8f734deeb05f5c8cad910275e4 (patch)
tree7f81cb0a496f8fc682b7cc106684d4ecbf2b3192 /src/Module.zig
parenta803e9cf48e9566638e6ec1e23fe0b885e2651ee (diff)
downloadzig-27f1ad8afde86c8f734deeb05f5c8cad910275e4.tar.gz
zig-27f1ad8afde86c8f734deeb05f5c8cad910275e4.zip
Module: add allowzero canonicalization to pointer types
Diffstat (limited to 'src/Module.zig')
-rw-r--r--src/Module.zig2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Module.zig b/src/Module.zig
index 22ac947cdf..ffc6a95fe1 100644
--- a/src/Module.zig
+++ b/src/Module.zig
@@ -6683,6 +6683,8 @@ pub fn ptrType(mod: *Module, info: InternPool.Key.PtrType) Allocator.Error!Type
var canon_info = info;
const have_elem_layout = info.elem_type.toType().layoutIsResolved(mod);
+ if (info.size == .C) canon_info.is_allowzero = true;
+
// Canonicalize non-zero alignment. If it matches the ABI alignment of the pointee
// type, we change it to 0 here. If this causes an assertion trip because the
// pointee type needs to be resolved more, that needs to be done before calling