================
@@ -5571,11 +5571,52 @@ LValue CodeGenFunction::EmitBinaryOperatorLValue(const 
BinaryOperator *E) {
       break;
     }
 
-    RValue RV = EmitAnyExpr(E->getRHS());
+    llvm::Value *Previous = nullptr;
+    RValue RV;
+    QualType SrcType = E->getRHS()->getType();
+    // Check if LHS is a bitfield, if RHS contains an implicit cast expression
+    // we want to extract that value and potentially (if the bitfield sanitizer
+    // is enabled) use it to check for an implicit conversion.
+    if (E->getLHS()->refersToBitField()) {
+      // Get the RHS before scalar conversion.
+      if (auto *ICE = GetOriginalRHSForBitfieldSanitizer(E)) {
----------------
zygoloid wrote:

What do you think about renaming this to `GetOriginalRHSForBitfieldAssignment`, 
given that we now use it unconditionally for all lowering of bitfield 
assignments?

https://github.com/llvm/llvm-project/pull/75481
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to