2
0
Эх сурвалжийг харах

Restored transitive behaviour of untraced modifier

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8386 8c9fc860-2736-0410-a75d-ab315db34111
negelef 6 жил өмнө
parent
commit
1e90c12cc1

+ 2 - 5
source/FoxArrayBase.Mod

@@ -260,10 +260,7 @@ VAR
 	(* set data base pointer (GC protection) *)
 	PROCEDURE PutPtr(CONST base: UnsafeArrayT; value: ANY);
 	BEGIN
-		base.ptr := value;
-		(*
 		SafePut(base.ptr,value);
-		*)
 	END PutPtr;
 
 	PROCEDURE GetSize( base: UnsafeArray ): SIZE;
@@ -1516,7 +1513,7 @@ Sufficient (but not necessary) conditions:
 
 		PROCEDURE CopyDescriptor;
 		BEGIN
-			dest.ptr := src.ptr;(* GC! Must do before MOVE (NIL <- src.ptr), then copy redundant *)
+			SafePut(dest.ptr, src.ptr);(* With refcount. GC! Must do before MOVE (NIL <- src.ptr), then copy redundant *)
 			SYSTEM.MOVE( src , dest, MathLenOffset + SIZEOF(LenInc) *  GetDim( src ));
 		END CopyDescriptor;
 
@@ -10709,4 +10706,4 @@ System.FreeDownTo FoxArrayBase ~
 
 
 
-Debugging.DisableGC 
+Debugging.DisableGC 

+ 3 - 3
source/FoxSyntaxTree.Mod

@@ -2536,10 +2536,10 @@ TYPE
 
 		PROCEDURE NeedsTrace* (): BOOLEAN;
 		BEGIN 
-			(*! semantic of x.y := new : 
-				if x is untraced then assignments to x^.y can be traced, depending on traceability of field y in x
+			(*! semantic of x.y.z := new : if x is untraced then the effect of y.z := new remains untraced! 
+				In other words: difference between y := x.y; y.z := new and x.y.z := new.
 			*)
-			RETURN type.NeedsTrace(); (* for x^: if x is an untraced pointer, the content of x^ is also treated untraced *)
+			RETURN left.NeedsTrace() & type.NeedsTrace(); (* for x^: if x is an untraced pointer, the content of x^ is also treated untraced *)
 		END NeedsTrace;
 
 	END DereferenceDesignator;