mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 13:30:45 +00:00
spirv: constant elem ptr fix
This commit is contained in:
parent
4ea361f6dc
commit
a7c3d5e4ec
@ -784,11 +784,12 @@ pub const DeclGen = struct {
|
||||
.opt_payload => unreachable, // TODO
|
||||
.comptime_field => unreachable,
|
||||
.elem => |elem_ptr| {
|
||||
const elem_ptr_ty = mod.intern_pool.typeOf(elem_ptr.base).toType();
|
||||
const parent_ptr_id = try self.constantPtr(elem_ptr_ty, elem_ptr.base.toValue());
|
||||
const parent_ptr_ty = mod.intern_pool.typeOf(elem_ptr.base).toType();
|
||||
const parent_ptr_id = try self.constantPtr(parent_ptr_ty, elem_ptr.base.toValue());
|
||||
const size_ty_ref = try self.sizeType();
|
||||
const index_id = try self.constInt(size_ty_ref, elem_ptr.index);
|
||||
return self.ptrAccessChain(result_ty_ref, parent_ptr_id, index_id, &.{});
|
||||
|
||||
return try self.ptrElemPtr(parent_ptr_ty, parent_ptr_id, index_id);
|
||||
},
|
||||
.field => unreachable, // TODO
|
||||
}
|
||||
|
||||
@ -219,7 +219,6 @@ test "slice string literal has correct type" {
|
||||
|
||||
test "result location zero sized array inside struct field implicit cast to slice" {
|
||||
if (builtin.zig_backend == .stage2_sparc64) return error.SkipZigTest; // TODO
|
||||
if (builtin.zig_backend == .stage2_spirv64) return error.SkipZigTest;
|
||||
|
||||
const E = struct {
|
||||
entries: []u32,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user