File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ class TestNullPointer : public TestFixture {
9292 TEST_CASE (functioncalllibrary); // use Library to parse function call
9393 TEST_CASE (functioncallDefaultArguments);
9494 TEST_CASE (nullpointer_internal_error); // #5080
95+ TEST_CASE (ticket6505);
9596 }
9697
9798 void check (const char code[], bool inconclusive = false , const char filename[] = " test.cpp" ) {
@@ -2443,6 +2444,22 @@ class TestNullPointer : public TestFixture {
24432444 " }\n " );
24442445 ASSERT_EQUALS (" " , errout.str ());
24452446 }
2447+
2448+ void ticket6505 () {
2449+ check (" void foo(MythSocket *socket) {\n "
2450+ " bool do_write=false;\n "
2451+ " if (socket) {\n "
2452+ " do_write=something();\n "
2453+ " }\n "
2454+ " if (do_write) {\n "
2455+ " socket->func();\n "
2456+ " }\n "
2457+ " }\n "
2458+ " void bar() {\n "
2459+ " foo(0);\n "
2460+ " }\n " , true , " test.c" );
2461+ ASSERT_EQUALS (" " , errout.str ());
2462+ }
24462463};
24472464
24482465REGISTER_TEST (TestNullPointer)
You can’t perform that action at this time.
0 commit comments