[llvm] [nsan] minor fix for the nsan pass (PR #101147)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 30 11:51:56 PDT 2024


================
@@ -850,7 +850,7 @@ void NumericalStabilitySanitizer::populateShadowStack(
   IRBuilder<> Builder(&CI);
   SmallVector<Value *, 8> ArgShadows;
   const bool ShouldCheckArgs = shouldCheckArgs(CI, TLI, CheckFunctionsFilter);
-  for (auto [ArgIdx, Arg] : enumerate(CI.operands())) {
+  for (auto &[ArgIdx, Arg] : enumerate(CI.operands())) {
----------------
MaskRay wrote:

There is no copy of `Arg`. `Arg` is by reference, even if we don't use `auto &`

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


More information about the llvm-commits mailing list