[all-commits] [llvm/llvm-project] 8a3d75: [ASan] Add read to large_func_test.cpp to prevent ...

Florian Hahn via All-commits all-commits at lists.llvm.org
Wed Mar 16 10:01:01 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8a3d75a76036569e011feabc6be36689e434fe66
      https://github.com/llvm/llvm-project/commit/8a3d75a76036569e011feabc6be36689e434fe66
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2022-03-16 (Wed, 16 Mar 2022)

  Changed paths:
    M compiler-rt/test/asan/TestCases/large_func_test.cpp

  Log Message:
  -----------
  [ASan] Add read to large_func_test.cpp to prevent optimization.

After e5822ded562f, the call to LargeFunction can be optimized out, as x
is never accessed in main. This is causing the test to fail, because the
out-of-bounds access won't be executed.

Adding an extra read and returning the value should prevent the
optimizer from removing the call.




More information about the All-commits mailing list