]> granicus.if.org Git - libexpat/commitdiff
Comment why default case in storeEntityValue is never executed
authorRhodri James <rhodri@kynesim.co.uk>
Mon, 15 May 2017 17:51:45 +0000 (18:51 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Sat, 22 Jul 2017 20:49:16 +0000 (22:49 +0200)
Also add comment tags so lcov can ignore unreachable code

expat/lib/xmlparse.c

index 77ada82fa900b72f85a954b733799ae800fa8398..c4c751183e03c1b74831e42ae130c7d30fe4efff 100644 (file)
@@ -5817,10 +5817,18 @@ storeEntityValue(XML_Parser parser,
       result = XML_ERROR_INVALID_TOKEN;
       goto endEntityValue;
     default:
+      /* This default case should be unnecessary -- all the tokens
+       * that XmlEntityValueTok() can return have their own explicit
+       * cases -- but should be retained for safety.  We do however
+       * exclude it from the coverage statistics.
+       *
+       * LCOV_EXCL_START
+       */
       if (enc == encoding)
         eventPtr = entityTextPtr;
       result = XML_ERROR_UNEXPECTED_STATE;
       goto endEntityValue;
+      /* LCOV_EXCL_STOP */
     }
     entityTextPtr = next;
   }