From 19c430530f6e2739222d4b9444e4ec3a6cb7b6a4 Mon Sep 17 00:00:00 2001 From: Ettl Martin Date: Thu, 14 Mar 2013 09:21:31 +0100 Subject: [PATCH] #3838 added another testcase to avoid a FP. --- test/testbufferoverrun.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/testbufferoverrun.cpp b/test/testbufferoverrun.cpp index d285f96c8..be3dcc425 100644 --- a/test/testbufferoverrun.cpp +++ b/test/testbufferoverrun.cpp @@ -1488,6 +1488,15 @@ private: "var[0].var[ 2 ] = 2;\n" "}"); ASSERT_EQUALS("", errout.str()); + + // avoid FP (example taken from #3838) + check("struct AB { int a[10]; int b[10]; };\n" + "int main() {\n" + " struct AB ab;\n" + " int * p = &ab[0].a[10]; \n" + " return 0;\n" + "}\n"); + ASSERT_EQUALS("", errout.str()); } void array_index_44() { // #3979 (false positive)