Browse Source

Added call to LeaveA2 / EnterA2 for functions with C calling convention

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7284 8c9fc860-2736-0410-a75d-ab315db34111
felixf 8 years ago
parent
commit
a8973c24e0
2 changed files with 2 additions and 2 deletions
  1. BIN
      WinAos/obg/FoxIntermediateBackend.GofW
  2. 2 2
      source/FoxIntermediateBackend.Mod

BIN
WinAos/obg/FoxIntermediateBackend.GofW


+ 2 - 2
source/FoxIntermediateBackend.Mod

@@ -5899,7 +5899,7 @@ TYPE
 						
 			ReleaseParameterRegisters();
 			
-			IF backend.trackLeave & ~isUnchecked & (procedureType.callingConvention = SyntaxTree.WinAPICallingConvention) THEN
+			IF backend.trackLeave & ~isUnchecked & (procedureType.callingConvention IN {SyntaxTree.WinAPICallingConvention, SyntaxTree.CCallingConvention}) THEN
 				SaveRegisters();ReleaseUsedRegisters(saved2);
 				CallThis(position,"Objects","LeaveA2",0);
 				RestoreRegisters(saved2);
@@ -5920,7 +5920,7 @@ TYPE
 				Emit(Result(position,return));
 			END;
 
-			IF  backend.trackLeave & ~isUnchecked & (procedureType.callingConvention = SyntaxTree.WinAPICallingConvention) THEN
+			IF  backend.trackLeave & ~isUnchecked & (procedureType.callingConvention  IN {SyntaxTree.WinAPICallingConvention, SyntaxTree.CCallingConvention}) THEN
 				IF  (procedureType.returnType # NIL) & ~structuredReturnType  THEN 
 					Emit(Push(position, return));
 					CallThis(position,"Objects","ReenterA2",0);