Browse Source

Patched bug -- the OnHeap check was not conservative enough. Temporarily disabled.

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

+ 5 - 2
source/FoxIntermediateBackend.Mod

@@ -7470,14 +7470,17 @@ TYPE
 			required for generational garbage collector
 		*)
 		PROCEDURE OnHeap(x: SyntaxTree.Expression): BOOLEAN;
-		VAR pos: LONGINT;
+		VAR pos: LONGINT; y: SyntaxTree.Expression;
 		BEGIN
+			RETURN TRUE;
+			(*! find a conservative and simple algorithm. The following does, for example, not work for records on the stack
+				passed by reference. 
 			pos := x.position.start;
 			WHILE (x # NIL) & ~(x IS SyntaxTree.DereferenceDesignator) & ~(x IS SyntaxTree.SelfDesignator) DO
 				x := x(SyntaxTree.Designator).left;
 			END;
-			(*TRACE(pos, x # NIL);*)
 			RETURN x # NIL;
+			 *)
 		END OnHeap;
 
 		PROCEDURE VisitBuiltinCallDesignator(x: SyntaxTree.BuiltinCallDesignator);