This is a work in progress patch. I try to detect such error:
void foo(int X) { int Buf[X]; Buf[X] = 0; }
The patch successfully detects this bug. However it writes FP when you try to take the address.
I would like to know if you think my approach to add a checkPreStmt is good. I would need to add logic to handle *(Buf+X) also.
This checker doesn't really logically belong in the ArrayBounds checker but from a user perspective it seems to belong there. I can move it to a new checker if that sounds best.