================ @@ -4425,6 +4425,14 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, Address Dest = EmitPointerWithAlignment(E->getArg(0)); Address Src = EmitPointerWithAlignment(E->getArg(1)); Value *SizeVal = EmitScalarExpr(E->getArg(2)); + if (BuiltinIDIfNoAsmLabel == Builtin::BI__builtin_trivially_relocate) + SizeVal = Builder.CreateMul( ---------------- cor3ntin wrote:
I think generally, there is the question of whether we want UBSAN to enforce the preconditions of trivially_relocate (object completeness, valid ranges), However, because the intent is for that builtin to be wrapped in a standard function, it's probably better to only do the checks there, it would integrate better with hardening/contracts, and we don't (afaik) have precondition checks for builtins https://github.com/llvm/llvm-project/pull/140312 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits