[cfe-commits] r62782 - /cfe/trunk/test/Analysis/outofbound.c

Zhongxing Xu xuzhongxing at gmail.com
Thu Jan 22 18:17:00 PST 2009


On Fri, Jan 23, 2009 at 4:36 AM, Ted Kremenek <kremenek at apple.com> wrote:

> Author: kremenek
> Date: Thu Jan 22 14:36:33 2009
> New Revision: 62782
>
> URL: http://llvm.org/viewvc/llvm-project?rev=62782&view=rev
> Log:
> Test more array logic in outofbound.c
>
> Modified:
>    cfe/trunk/test/Analysis/outofbound.c
>
> Modified: cfe/trunk/test/Analysis/outofbound.c
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Analysis/outofbound.c?rev=62782&r1=62781&r2=62782&view=diff
>
>
> ==============================================================================
> --- cfe/trunk/test/Analysis/outofbound.c (original)
> +++ cfe/trunk/test/Analysis/outofbound.c Thu Jan 22 14:36:33 2009
> @@ -2,5 +2,6 @@
>
>  char f1() {
>   char* s = "abcd";
> -  return s[6]; // expected-warning{{Load or store into an out-of-bound
> memory position.}}
> +  char c = s[4]; // no-warning
> +  return s[5] + c; // expected-warning{{Load or store into an out-of-bound
> memory position.}}


Hi Ted,

s[5] is a legal position. Strings are terminated by '\0'.


>  }
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20090123/1fcfcdf3/attachment.html>


More information about the cfe-commits mailing list