Inconsistent argument number between function decl and callee site causes Clang crash

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Inconsistent argument number between function decl and callee site causes Clang crash

Zhenbo Xu
Hi everybody,
Clang Static Analyzer crashes when the argument number of function's callee site is greater than function decl.
The following is a simple test case:

//Run %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-store=region -analyzer-inline-call
#include <stdlib.h>
void f1() {
}

void f() {
int *p = malloc(32);
f1(p);
}

Attachment is the patch.


--
  Zhenbo Xu


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev

RegionStore.patch (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Inconsistent argument number between function decl and callee site causes Clang crash

Ted Kremenek
Thanks Zhenbo.  I've applied your fix here (with a few formatting tweaks):

http://llvm.org/viewvc/llvm-project?view=rev&revision=123458


On Jan 14, 2011, at 6:47 AM, Zhenbo Xu wrote:

> Hi everybody,
> Clang Static Analyzer crashes when the argument number of function's callee site is greater than function decl.
> The following is a simple test case:
>
> //Run %clang_cc1 -analyze -analyzer-check-objc-mem -analyzer-store=region -analyzer-inline-call
> #include <stdlib.h>
> void f1() {
> }
>
> void f() {
> int *p = malloc(32);
> f1(p);
> }
>
> Attachment is the patch.
>
>
> --
>   Zhenbo Xu
>
> <RegionStore.patch>_______________________________________________
> cfe-dev mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev