You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by bc...@apache.org on 2019/05/15 21:04:23 UTC

[trafficserver] branch master updated: clang analzyer - fix false positive in Vol::handle_recover_from_data.

This is an automated email from the ASF dual-hosted git repository.

bcall pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 554c828  clang analzyer - fix false positive in Vol::handle_recover_from_data.
554c828 is described below

commit 554c828ae2c5cc657e665d202fbe9290582e5efa
Author: Alan M. Carroll <am...@apache.org>
AuthorDate: Wed May 15 14:27:55 2019 -0500

    clang analzyer - fix false positive in Vol::handle_recover_from_data.
---
 iocore/cache/Cache.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/iocore/cache/Cache.cc b/iocore/cache/Cache.cc
index 98eb09b..cd2668e 100644
--- a/iocore/cache/Cache.cc
+++ b/iocore/cache/Cache.cc
@@ -1490,6 +1490,9 @@ Vol::handle_recover_from_data(int event, void * /* data ATS_UNUSED */)
       }
     }
 
+    // If execution reaches here, then @c got_len > 0 and e == s + got_len therefore s < e
+    // clang analyzer can't figure this out, so be explicit.
+    ink_assert(s < e);
     while (s < e) {
       doc = (Doc *)s;