authorgravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-01-17 19:31:00+02:00
committergravatar for git@vexu.euVeikka Tuominen <git@vexu.eu> 2023-01-17 20:28:43+02:00
log3b2c4211027c235e3bc38043be99fc5be5e870e1
treeb456f306f2bf50e79cabe5dc2c46c667540641a7
parente04547642ac2d0c1cba010b6101bb30c210735cb

Sema: fix bad boolean logic for cast to null panic

Closes #14349

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

src/Sema.zig+1-1
......@@ -27330,7 +27330,7 @@ fn coerceCompatiblePtrs(
2733027330 return sema.addConstant(dest_ty, val);
2733127331 }
2733227332 try sema.requireRuntimeBlock(block, inst_src, null);
27333 const inst_allows_zero = (inst_ty.zigTypeTag() == .Pointer and inst_ty.ptrAllowsZero()) or true;
27333 const inst_allows_zero = inst_ty.zigTypeTag() != .Pointer or inst_ty.ptrAllowsZero();
2733427334 if (block.wantSafety() and inst_allows_zero and !dest_ty.ptrAllowsZero() and
2733527335 try sema.typeHasRuntimeBits(dest_ty.elemType2()))
2733627336 {