[PATCH] Fix analyzer crash when defining strange prototype of malloc

Daniel Fahlgren daniel at fahlgren.se
Mon Aug 25 01:49:34 PDT 2014


Hi,

If you change the prototype of malloc it is possible to cause the
analyzer to crash. This simple example will give you such a crash:

void malloc(int i);

void foo()
{
  malloc(1);
}

It is the assertion on line 161 in SValBuilder.cpp that fails. Attached
is a simple patch that fixes this, but I'm not sure the fix is correct.
There seems to be a similar check a couple of lines further down in the
code.

Best regards,
Daniel Fahlgren
-------------- next part --------------
A non-text attachment was scrubbed...
Name: analyzer_crash.patch
Type: text/x-patch
Size: 714 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140825/b4addd06/attachment.bin>


More information about the cfe-commits mailing list