diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2023-05-29 00:10:36 -0400 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-06-10 20:47:56 -0700 |
| commit | 32692569656d9a178abb24f8fb7893395700cb62 (patch) | |
| tree | c2f10d2ed2d1d5e0e6c1cd2d532c6d76d401a466 /src/type.zig | |
| parent | 3064d2aa7b9a8ea836cb70884b0640fe902ecc29 (diff) | |
| download | zig-32692569656d9a178abb24f8fb7893395700cb62.tar.gz zig-32692569656d9a178abb24f8fb7893395700cb62.zip | |
behavior: fix more compiler crashes
Diffstat (limited to 'src/type.zig')
| -rw-r--r-- | src/type.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/type.zig b/src/type.zig index 27c7756a68..0ce242b616 100644 --- a/src/type.zig +++ b/src/type.zig @@ -630,7 +630,6 @@ pub const Type = struct { pub fn hasWellDefinedLayout(ty: Type, mod: *Module) bool { return switch (mod.intern_pool.indexToKey(ty.toIntern())) { .int_type, - .ptr_type, .vector_type, => true, @@ -646,6 +645,7 @@ pub const Type = struct { .array_type => |array_type| array_type.child.toType().hasWellDefinedLayout(mod), .opt_type => ty.isPtrLikeOptional(mod), + .ptr_type => |ptr_type| ptr_type.size != .Slice, .simple_type => |t| switch (t) { .f16, @@ -1578,7 +1578,7 @@ pub const Type = struct { .int_type => |int_type| return int_type.bits, .ptr_type => |ptr_type| switch (ptr_type.size) { .Slice => return target.ptrBitWidth() * 2, - else => return target.ptrBitWidth() * 2, + else => return target.ptrBitWidth(), }, .anyframe_type => return target.ptrBitWidth(), |
