[PATCH] Fixes in LargeMmapAllocator::GetBlockBegin().

Kostya Serebryany kcc at google.com
Fri Apr 5 08:09:25 PDT 2013


  >> Should I create a regression test for this specific boundary condition? That seems a bit excessive.
  Why adding one more CHECK for which you are doing a fix is excessive?

  This change will affect the following test in asan (the report will be broken):
  #include <stdlib.h>
  #include <string.h>
  int main(int argc, char **argv) {
    char *x = (char*)malloc(1 << 20);
    memset(x, 0, 10);
    int res = x[-argc * 4000];  // BOOOM
    free(x);
    return res;
  }

  not sure if we should consider it as an asan bug or not,
  but please don't commit the second check before we decide what to do here.

http://llvm-reviews.chandlerc.com/D624



More information about the llvm-commits mailing list