[llvm-bugs] [Bug 36510] ASan: posix_memalign returns invalid value when allocation fails (macOS)

via llvm-bugs llvm-bugs at lists.llvm.org
Sat Mar 24 17:56:22 PDT 2018


https://bugs.llvm.org/show_bug.cgi?id=36510

Johan Engelen <jbc.engelen at gmail.com> changed:

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

--- Comment #4 from Johan Engelen <jbc.engelen at gmail.com> ---
Fixed in trunk.

Tested with LDC+LVMtrunk and D code:
```
import std.stdio;
import core.sys.posix.stdlib;

void main()
{
    void* result;
    writeln( posix_memalign(&result, 1, size_t.max), " (expected 22)");
    writeln( posix_memalign(&result, 32, size_t.max), " (expected 12)");
}
```

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20180325/977e0eb5/attachment.html>


More information about the llvm-bugs mailing list