From 0b36ece04983cfc488944712d2645feceb3a365c Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Sun, 8 Aug 2021 10:55:10 +0200 Subject: [PATCH] #8482: Added another regression test --- test/testnullpointer.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/testnullpointer.cpp b/test/testnullpointer.cpp index 7451b5ad0..a00958d51 100644 --- a/test/testnullpointer.cpp +++ b/test/testnullpointer.cpp @@ -1473,6 +1473,23 @@ private: " (void)f->x;\n" "}\n", true); ASSERT_EQUALS("", errout.str()); + + check("typedef struct\n" + "{\n" + " int x;\n" + "} F;\n" + "\n" + "static void foo(F* f)\n" + "{\n" + " if( !f || f->x == 0 )\n" + " {\n" + " if( !f )\n" + " return;\n" + " }\n" + "\n" + " (void)f->x;\n" + "}", true); + ASSERT_EQUALS("", errout.str()); } void nullpointer32() { // #8460