[LLVMbugs] [Bug 7490] [miscompile] Incomplete default initialization of arrays

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jun 25 13:32:01 CDT 2010


http://llvm.org/bugs/show_bug.cgi?id=7490

Fariborz Jahanian <fjahanian at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #2 from Fariborz Jahanian <fjahanian at apple.com> 2010-06-25 13:32:01 CDT ---
(In reply to comment #1)
> Ouch, this sounds like a really nasty miscompilation.  Fariborz, can you take a
> look as soon as reasonably possible?

Fixed in TOT: http://llvm.org/viewvc/llvm-project?view=rev&revision=106869

Following test case was added to llvm test suite:

#include <assert.h>

void func() {
  int *buckets = new int[111]();
  for (int i = 0; i < 111; i++)
    assert(buckets[i] == 0);
  for (int i = 0; i < 111; i++)
    buckets[i] = i;

  delete [] buckets;
}

int main(int argc, char **argv) {
    func();
    func();
    func();
    func();
    func();
    return 0;
}

Let me know if poisoning malloc() now works for you.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the LLVMbugs mailing list