aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2016-08-10 10:52:12 -0400
committerKevin O'Connor <kevin@koconnor.net>2016-08-10 15:01:03 -0400
commit996a8a9504f33e318750fbdfa3d0d529654e215a (patch)
tree7ffe65236275d98558c7b06f456e2d52a7db407c /scripts
parent8bc6d9f8e9bd1c211660f9ec91c237821d7f4089 (diff)
downloadseabios-hppa-996a8a9504f33e318750fbdfa3d0d529654e215a.zip
seabios-hppa-996a8a9504f33e318750fbdfa3d0d529654e215a.tar.gz
seabios-hppa-996a8a9504f33e318750fbdfa3d0d529654e215a.tar.bz2
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 <kevin@koconnor.net>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/checkstack.py5
1 files changed, 5 insertions, 0 deletions
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