wasm: fix getting pointer type instead of error union type for is_err_ptr

This commit is contained in:
Justus Klausecker
2026-01-10 18:18:48 +01:00
committed by Matthew Lugg
parent dbfeade221
commit 078e100573
+4 -1
View File
@@ -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: {