[Pkg-libvirt-commits] [libguestfs] 62/266: lua: always return luaL_error in actions

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:41:42 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.35-1
in repository libguestfs.

commit 5fddd932054b1e4213807c545f85f5c0b3d698f7
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Thu Aug 7 19:26:46 2014 +0200

    lua: always return luaL_error in actions
    
    Even if luaL_error is a "no return" function for the Lua runtime, adopt
    also in action functions the "return" idiom recommeded for it.
    
    This also helps code analyzers in not thinking that "g" might still be
    null after the null check followed by luaL_error.
---
 generator/lua.ml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/generator/lua.ml b/generator/lua.ml
index 9bd4006..5d5619c 100644
--- a/generator/lua.ml
+++ b/generator/lua.ml
@@ -482,8 +482,8 @@ guestfs_lua_delete_event_callback (lua_State *L)
       pr "\n";
 
       pr "  if (g == NULL)\n";
-      pr "    luaL_error (L, \"Guestfs.%%s: handle is closed\",\n";
-      pr "                \"%s\");\n" name;
+      pr "    return luaL_error (L, \"Guestfs.%%s: handle is closed\",\n";
+      pr "                       \"%s\");\n" name;
       pr "\n";
 
       iteri (

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list