aboutsummaryrefslogtreecommitdiff
path: root/clang/test
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2009-11-11 17:17:06 +0000
committerTed Kremenek <kremenek@apple.com>2009-11-11 17:17:06 +0000
commit91989d166a0ec952eef72be043c02414792bb34c (patch)
tree5cf542a9ea56e88961fbe010f43d8a14d290b42d /clang/test
parent38fee967aed4371642903350e327a1c53e54e271 (diff)
downloadllvm-91989d166a0ec952eef72be043c02414792bb34c.zip
llvm-91989d166a0ec952eef72be043c02414792bb34c.tar.gz
llvm-91989d166a0ec952eef72be043c02414792bb34c.tar.bz2
Split buffer overflow test case into two test cases, removing out logic that was commented out.
llvm-svn: 86845
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/rdar-6541136-region.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/test/Analysis/rdar-6541136-region.c b/clang/test/Analysis/rdar-6541136-region.c
index a07308f..cb7bf3a 100644
--- a/clang/test/Analysis/rdar-6541136-region.c
+++ b/clang/test/Analysis/rdar-6541136-region.c
@@ -6,17 +6,22 @@ extern kernel_tea_cheese_t _wonky_gesticulate_cheese;
// This test case exercises the ElementRegion::getRValueType() logic.
-
-void foo( void )
-{
+void test1( void ) {
kernel_tea_cheese_t *wonky = &_wonky_gesticulate_cheese;
struct load_wine *cmd = (void*) &wonky[1];
cmd = cmd;
char *p = (void*) &wonky[1];
- //*p = 1; // this is also an out-of-bound access.
kernel_tea_cheese_t *q = &wonky[1];
// This test case tests both the RegionStore logic (doesn't crash) and
// the out-of-bounds checking. We don't expect the warning for now since
// out-of-bound checking is temporarily disabled.
kernel_tea_cheese_t r = *q; // expected-warning{{Access out-of-bound array element (buffer overflow)}}
}
+
+void test1_b( void ) {
+ kernel_tea_cheese_t *wonky = &_wonky_gesticulate_cheese;
+ struct load_wine *cmd = (void*) &wonky[1];
+ cmd = cmd;
+ char *p = (void*) &wonky[1];
+ *p = 1; // expected-warning{{Access out-of-bound array element (buffer overflow)}}
+}