================
@@ -783,7 +783,14 @@ void CodeGenFunction::EmitNullabilityCheck(LValue LHS, 
llvm::Value *RHS,
   auto CheckOrdinal = SanitizerKind::SO_NullabilityAssign;
   auto CheckHandler = SanitizerHandler::TypeMismatch;
   SanitizerDebugLocation SanScope(this, {CheckOrdinal}, CheckHandler);
-  llvm::Value *IsNotNull = Builder.CreateIsNotNull(RHS);
+  llvm::Value *IsNotNull;
+  if (RHS->getType()->isAggregateType()) {
----------------
efriedma-quic wrote:

This should be `if (auto *MPT = LHS.getType()->getAs<MemberPointerType>())` or 
something like that.  Consider:

```
struct S { int a; };
void f() {
  int S::* _Nonnull x  = nullptr;
}
```

https://github.com/llvm/llvm-project/pull/227738
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to