File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ void CheckIO::checkFileUsage()
148148 i->second .lastOperation = Filepointer::UNKNOWN_OP;
149149 }
150150 }
151- } else if (tok->str () == " return" || tok->str () == " continue" || tok->str () == " break" ) { // Reset upon return, continue or break
151+ } else if (tok->str () == " return" || tok->str () == " continue" || tok->str () == " break" || _settings-> library . isnoreturn (tok) ) { // Reset upon return, continue or break
152152 for (std::map<unsigned int , Filepointer>::iterator i = filepointers.begin (); i != filepointers.end (); ++i) {
153153 i->second .mode_indent = 0 ;
154154 i->second .mode = UNKNOWN_OM;
Original file line number Diff line number Diff line change @@ -480,6 +480,18 @@ class TestIO : public TestFixture {
480480 " }" );
481481 ASSERT_EQUALS (" " , errout.str ());
482482
483+ check (" void chdcd_parse_nero(FILE *infile) {\n "
484+ " switch (mode) {\n "
485+ " case 0x0300:\n "
486+ " fclose(infile);\n "
487+ " exit(0);\n "
488+ " case 0x0500:\n "
489+ " fclose(infile);\n "
490+ " return;\n "
491+ " }\n "
492+ " }" );
493+ ASSERT_EQUALS (" " , errout.str ());
494+
483495 // #4649
484496 check (" void foo() {\n "
485497 " struct {FILE *f1; FILE *f2;} a;\n "
You can’t perform that action at this time.
0 commit comments