From e13a182990c638bb69cd04e253ad6e0ecd734407 Mon Sep 17 00:00:00 2001 From: g-w1 <58830309+g-w1@users.noreply.github.com> Date: Mon, 21 Jun 2021 11:47:34 -0400 Subject: stage2 Sema: implement @intToPtr (#9144) Co-authored-by: Veikka Tuominen --- src/type.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/type.zig') diff --git a/src/type.zig b/src/type.zig index 410773b649..549b15f366 100644 --- a/src/type.zig +++ b/src/type.zig @@ -1538,7 +1538,7 @@ pub const Type = extern union { .optional_single_const_pointer, .optional_single_mut_pointer, => { - if (self.elemType().hasCodeGenBits()) return 1; + if (!self.elemType().hasCodeGenBits()) return 1; return @divExact(target.cpu.arch.ptrBitWidth(), 8); }, @@ -1550,7 +1550,7 @@ pub const Type = extern union { .c_mut_pointer, .pointer, => { - if (self.elemType().hasCodeGenBits()) return 0; + if (!self.elemType().hasCodeGenBits()) return 0; return @divExact(target.cpu.arch.ptrBitWidth(), 8); }, -- cgit v1.2.3