================ @@ -4238,7 +4238,8 @@ static Value *emitPointerArithmetic(CodeGenFunction &CGF, else elemTy = CGF.ConvertTypeForMem(elementType); - if (CGF.getLangOpts().PointerOverflowDefined) + if (CGF.getLangOpts().PointerOverflowDefined || + CGF.isUnderlyingBasePointerConstantNull(pointerOperand)) ---------------- efriedma-quic wrote:
What's the expected interaction between isUnderlyingBasePointerConstantNull and BinaryOperator::isNullPointerArithmeticExtension ? They aren't quite the same thing, but they seem pretty closely related. https://github.com/llvm/llvm-project/pull/137849 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits