From 8b7964632adec3d58e20fe0c60c125a70be5943a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emmanuel=20Beno=C3=AEt?= Date: Mon, 13 Nov 2017 18:53:42 +0100 Subject: [PATCH] Compiler - Additional asserts on FPU stack --- opcomp.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/opcomp.cc b/opcomp.cc index 73f2499..876c6c4 100644 --- a/opcomp.cc +++ b/opcomp.cc @@ -728,6 +728,7 @@ void T_CompilerImpl_::processFunction( { if ( exit ) { assert( sdMain == args + lvars + 1 ); + assert( sdFPU == 0 ); if ( lvars ) { addInstruction( OP_POP , lvars - 1 , location ); sdMain -= lvars; @@ -846,7 +847,7 @@ void T_CompilerImpl_::applyStackEffects( } if ( f ) { - assert( f > 0 || sdFPU >= uint32_t( -m ) ); + assert( ( f > 0 && sdFPU + f < 8 ) || ( f < 0 && sdFPU >= uint32_t( -m ) ) ); sdFPU += m; } }