]> git.cworth.org Git - apitrace/commitdiff
Allow failure handling for functions without return value.
authorJosé Fonseca <jfonseca@vmware.com>
Thu, 25 Jun 2009 12:56:57 +0000 (13:56 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 25 Jun 2009 12:56:57 +0000 (13:56 +0100)
base.py

diff --git a/base.py b/base.py
index c27a3c23760d12abd3a018ea728f618cd1dd9970..24641bc16aefb4648ed90d3832bbe9190c9f89a3 100644 (file)
--- a/base.py
+++ b/base.py
@@ -289,8 +289,12 @@ class Function:
 
     def fail_impl(self):
         if self.fail is not None:
-            assert self.type is not Void
-            print '            return %s;' % self.fail
+            if self.type is Void:
+                assert self.fail == ''
+                print '            return;' 
+            else:
+                assert self.fail != ''
+                print '            return %s;' % self.fail
         else:
             print '            ExitProcess(0);'