[clang] [Clang][UBSan] Use EmitCheckedLValue for C++ trivial operator= operands (PR #203737)

Tony Varghese via cfe-commits cfe-commits at lists.llvm.org
Thu Jun 18 05:50:55 PDT 2026


================
@@ -126,12 +123,30 @@ void test_oob_lhs(void) {
 }
 #endif
 
-// C++ RHS cases - handler call only
+// C++ cases - handler call only
 
 #ifdef __cplusplus
 
 extern "C" {
 
+// C++ LHS cases
+
+// CXX-LABEL: define {{.*}}@test_cxx_lhs_dot_operator_function_call(
+// CXX: call void @__ubsan_handle_type_mismatch_v1_abort
----------------
tonykuttai wrote:

Feels this is a weak check. Do we need to make sure `src` is actually getting checked here? (and maybe check both null and alignment checks are performed. but this I will leave it to you)

https://github.com/llvm/llvm-project/pull/203737


More information about the cfe-commits mailing list