mirror of
https://codeberg.org/ziglang/zig.git
synced 2026-04-27 19:09:47 +03:00
wasm: fix getting pointer type instead of error union type for is_err_ptr
This commit is contained in:
committed by
Matthew Lugg
parent
dbfeade221
commit
078e100573
@@ -4114,7 +4114,10 @@ fn airIsErr(cg: *CodeGen, inst: Air.Inst.Index, opcode: std.wasm.Opcode, op_kind
|
||||
const zcu = cg.pt.zcu;
|
||||
const un_op = cg.air.instructions.items(.data)[@intFromEnum(inst)].un_op;
|
||||
const operand = try cg.resolveInst(un_op);
|
||||
const err_union_ty = cg.typeOf(un_op);
|
||||
const err_union_ty = switch (op_kind) {
|
||||
.value => cg.typeOf(un_op),
|
||||
.ptr => cg.typeOf(un_op).childType(zcu),
|
||||
};
|
||||
const pl_ty = err_union_ty.errorUnionPayload(zcu);
|
||||
|
||||
const result: WValue = result: {
|
||||
|
||||
Reference in New Issue
Block a user