[PATCH] D27083: [sanitizer] Handle malloc_destroy_zone() on Darwin
Anna Zaks via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 5 10:54:48 PST 2016
zaks.anna added inline comments.
================
Comment at: lib/sanitizer_common/sanitizer_malloc_mac.inc:75
+ if (malloc_num_zones > 1 && malloc_zones[0] != &sanitizer_zone) {
+ for (unsigned i = 0; i < malloc_num_zones; i++) {
+ if (malloc_zones[i] == &sanitizer_zone) {
----------------
Iteration should start with 1 since the condition will always be false for i==0. The current version is correct, but was a bit more complicated to reason about since the intention is never to malloc_zones[0] with malloc_zones[0].
https://reviews.llvm.org/D27083
More information about the llvm-commits
mailing list