]> Git Repo - qemu.git/commitdiff
decodetree: Do not unconditionaly return from Pattern.output_code
authorRichard Henderson <[email protected]>
Sat, 23 Feb 2019 16:57:46 +0000 (08:57 -0800)
committerRichard Henderson <[email protected]>
Tue, 12 Mar 2019 16:46:58 +0000 (09:46 -0700)
As a consequence, the 'return false' gets pushed up one level.

This will allow us to perform some other action when the
translator returns failure.

Tested-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Bastian Koppelmann <[email protected]>
Signed-off-by: Richard Henderson <[email protected]>
scripts/decodetree.py

index e26d8253f23f3b9726d1edb0151d3125162f2272..cc5fa1a8abb2cc24666f242027376c934eaa3718 100755 (executable)
@@ -348,8 +348,8 @@ class Pattern(General):
             output(ind, self.base.extract_name(), '(&u.f_', arg, ', insn);\n')
         for n, f in self.fields.items():
             output(ind, 'u.f_', arg, '.', n, ' = ', f.str_extract(), ';\n')
-        output(ind, 'return ', translate_prefix, '_', self.name,
-               '(ctx, &u.f_', arg, ');\n')
+        output(ind, 'if (', translate_prefix, '_', self.name,
+               '(ctx, &u.f_', arg, ')) return true;\n')
 # end Pattern
 
 
@@ -777,8 +777,8 @@ class Tree:
             output(ind, '    /* ',
                    str_match_bits(innerbits, innermask), ' */\n')
             s.output_code(i + 4, extracted, innerbits, innermask)
+            output(ind, '    return false;\n')
         output(ind, '}\n')
-        output(ind, 'return false;\n')
 # end Tree
 
 
@@ -932,6 +932,7 @@ def main():
     output(i4, '} u;\n\n')
 
     t.output_code(4, False, 0, 0)
+    output(i4, 'return false;\n')
 
     output('}\n')
 
This page took 0.027775 seconds and 4 git commands to generate.