================ @@ -3615,9 +3616,12 @@ void CodeGenFunction::EmitCheck( if (!CGM.getCodeGenOpts().SanitizeMergeHandlers.has(Checked[i].second)) NoMerge = true; + + if (!CGM.getCodeGenOpts().NoSanitizeTopHot.has(Checked[i].second)) + SanitizeGuardChecks = true; } - if (ClSanitizeGuardChecks) { + if (SanitizeGuardChecks) { llvm::Value *Allow = Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::allow_ubsan_check), llvm::ConstantInt::get(CGM.Int8Ty, CheckHandler)); ---------------- vitalybuka wrote:
It's maybe not important for the patch, but we will have a problem here. LLVM pass will need to lookup fraction by the argument, but the argument is `CheckHandler` which is not the same as NoSanitizeTopHot. but maybe we need to think a little bit now. Assuming very few `Checked.size() > 1` also `Checked[i].second` is usually 1 bit. Probably correct approach will be to apply llvm::Intrinsic::allow_ubsan_check on line 3606? And use the bit with with highest sanitizer coverage as ID. WDYT? https://github.com/llvm/llvm-project/pull/121619 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits