[PATCH] [compiler-rt] Fix a flaky heap-overflow-large.cc test

Kuba Brecka kuba.brecka at gmail.com
Sun Mar 22 10:51:04 PDT 2015


Ah, forgot the `unsigned`...


http://reviews.llvm.org/D8515

Files:
  test/asan/TestCases/heap-overflow-large.cc

Index: test/asan/TestCases/heap-overflow-large.cc
===================================================================
--- test/asan/TestCases/heap-overflow-large.cc
+++ test/asan/TestCases/heap-overflow-large.cc
@@ -15,9 +15,9 @@
   int *x = new int[5];
   memset(x, 0, sizeof(x[0]) * 5);
   int index = atoi(argv[1]);
-  int res = x[index];
+  unsigned res = x[index];
   // CHECK: main
   // CHECK-NOT: CHECK failed
   delete[] x;
-  return res ? res : 1;
+  return (res % 10) + 1;
 }

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8515.22421.patch
Type: text/x-patch
Size: 487 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150322/c6ceb8cd/attachment.bin>


More information about the llvm-commits mailing list