authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-08-26 19:53:36-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-08-26 19:53:36-07:00
logb0995cb9f9540a6d463dcc2722cb3b8918a61e8e
tree851e5f39cdfd916c395e405d29ddad056c29d5df
parentcc26cb9b2366723a8149e9f79e8252936cb69b73

stage2: correct logic for analyzeIsNull


1 files changed, 2 insertions(+), 1 deletions(-)

src-self-hosted/Module.zig+2-1
......@@ -2572,7 +2572,8 @@ pub fn analyzeIsNull(
25722572) InnerError!*Inst {
25732573 if (operand.value()) |opt_val| {
25742574 const is_null = opt_val.isNull();
2575 return self.constBool(scope, src, invert_logic);
2575 const bool_value = if (invert_logic) !is_null else is_null;
2576 return self.constBool(scope, src, bool_value);
25762577 }
25772578 const b = try self.requireRuntimeBlock(scope, src);
25782579 const inst_tag: Inst.Tag = if (invert_logic) .isnonnull else .isnull;