You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by jp...@apache.org on 2016/08/18 22:14:45 UTC

[trafficserver] branch master updated: Fix static analysis warnings in Lua bindings.

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

jpeach pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

The following commit(s) were added to refs/heads/master by this push:
       new  fe413ca   Fix static analysis warnings in Lua bindings.
fe413ca is described below

commit fe413cae7582a629f49c811c1eebc23e47fce0ed
Author: James Peach <jp...@apache.org>
AuthorDate: Thu Aug 18 15:13:13 2016 -0700

    Fix static analysis warnings in Lua bindings.
    
    The Lua error APIs are not annotated, so the clang static analyzer
    doesn't know that they unwind the stack without returning. Just add
    some fake returns to keep squash the analyzer warnings.
---
 proxy/logging/LogBindings.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/proxy/logging/LogBindings.cc b/proxy/logging/LogBindings.cc
index 45f05d3..ce263a1 100644
--- a/proxy/logging/LogBindings.cc
+++ b/proxy/logging/LogBindings.cc
@@ -64,6 +64,7 @@ refcount_object_get(lua_State *L, int index, const char *type_name)
   ptr = (RefCountObj **)luaL_checkudata(L, index, type_name);
   if (!ptr) {
     luaL_typerror(L, index, type_name);
+    return NULL; // Not reached, since luaL_typerror throws.
   }
 
   return dynamic_cast<T *>(*ptr);
@@ -103,7 +104,8 @@ create_filter_object(lua_State *L, const char *name, LogFilter::Action action)
 
   filter = LogFilter::parse("lua", action, condition);
   if (filter == NULL) {
-    luaL_error(L, "invalid filter condition '%s'", condition);
+    // NOTE: Not really a return since luaL_error throws.
+    return (luaL_error(L, "invalid filter condition '%s'", condition));
   }
 
   return refcount_object_new(L, "log.filter", filter);

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].