瀏覽代碼

a fix: Context.topNet was not correctly assigned

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@6583 8c9fc860-2736-0410-a75d-ab315db34111
eth.morozova 9 年之前
父節點
當前提交
3e8b6b74c3
共有 1 個文件被更改,包括 4 次插入5 次删除
  1. 4 5
      source/ActiveCellsRuntime.mod

+ 4 - 5
source/ActiveCellsRuntime.mod

@@ -1,5 +1,5 @@
 (** Active Cells Runtime Base Code for Variations of ActiveCellsRuntime Implementations  
-	Felix Friedrich, ETH Zürich, 2015
+	Felix Friedrich, ETH Z 2015
 *)
 module ActiveCellsRuntime;
 
@@ -122,15 +122,14 @@ type
 		c := a(Cell);
 		context.Allocate(s, ac, typeInfo, name, isCellnet, isEngine);
 		c.c := ac;
+		
+		if scope = nil then context.topNet := ac; end;
 	end AllocateOnContext;
 	
 
 	procedure Allocate*(scope: Cell; var c: Cell; tag: address; const name: array of char; isCellnet, isEngine: boolean);
-	var ctx: Context;
 	begin
-		ctx := GetContext();
-		AllocateOnContext(ctx, scope, c, tag, name, isCellnet, isEngine);
-		if scope = nil then ctx.topNet := c.c; end;
+		AllocateOnContext(GetContext(), scope, c, tag, name, isCellnet, isEngine);
 	end Allocate;
 
 	procedure AddPort*(c: Cell; var p: any; const name: array of char; inout: set; width: longint);