From: Kevin O'Connor Date: Wed, 10 Aug 2016 14:52:12 +0000 (-0400) Subject: checkstack: Handle conditional checks at start of functions X-Git-Tag: rel-1.10.0~27 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=996a8a9504f33e318750fbdfa3d0d529654e215a;p=seabios.git checkstack: Handle conditional checks at start of functions Recent versions of gcc will sometimes place conditional checks in the code prior to setting up the function's stack frame. Handle this case correctly. Signed-off-by: Kevin O'Connor --- diff --git a/scripts/checkstack.py b/scripts/checkstack.py index 5d9b0bf..255768a 100755 --- a/scripts/checkstack.py +++ b/scripts/checkstack.py @@ -153,6 +153,11 @@ def main(): if '%esp' in insn or insn.startswith('leal'): # Still part of initial header continue + if not stackusage and ( + insn.startswith('test') or insn.startswith('cmp') + or insn.startswith('j')): + # There may be conditional checks prior to stack frame + continue cur.basic_stack_usage = stackusage atstart = 0