Browse Source

Debugging inline calles: use result designator in inline calls

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@7012 8c9fc860-2736-0410-a75d-ab315db34111
felixf 8 years ago
parent
commit
ea53d1158d
1 changed files with 7 additions and 1 deletions
  1. 7 1
      source/FoxIntermediateBackend.Mod

+ 7 - 1
source/FoxIntermediateBackend.Mod

@@ -5226,6 +5226,7 @@ TYPE
 			prevInlineExit : Label;
 			prevMapper: SymbolMapper;
 			tooComplex: BOOLEAN;
+			resultDesignator: SyntaxTree.Expression;
 
 			PROCEDURE SimpleExpression(e: SyntaxTree.Expression): BOOLEAN;
 			BEGIN
@@ -5258,6 +5259,7 @@ TYPE
 
 
 		BEGIN
+			resultDesignator := procedureResultDesignator; procedureResultDesignator := NIL;
 			wasInline := currentIsInline;
 			prevInlineExit := currentInlineExit;
 			prevMapper := currentMapper;
@@ -5330,7 +5332,11 @@ TYPE
 
 
 			IF ~tooComplex & (procedureType.returnType # NIL) THEN
-				returnDesignator := GetTemp(procedureType.returnType, TRUE);
+				IF resultDesignator # NIL THEN
+					returnDesignator := resultDesignator
+				ELSE
+					returnDesignator := GetTemp(procedureType.returnType, TRUE);
+				END;
 				currentMapper.Add(NIL, returnDesignator, NIL);
 			END;