浏览代码

procedure array patched

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@6479 8c9fc860-2736-0410-a75d-ab315db34111
felixf 9 年之前
父节点
当前提交
1eeca1b5a5
共有 1 个文件被更改,包括 17 次插入2 次删除
  1. 17 2
      source/FoxIntermediateBackend.Mod

+ 17 - 2
source/FoxIntermediateBackend.Mod

@@ -12092,8 +12092,10 @@ TYPE
 					Info(source,"name");
 					procedure.GetName(name);
 					LongName(source, name);
-					
-					Address(source, 0);
+
+					Global.GetSymbolSegmentedName(procedure, segmentedName);
+					NamedSymbol(source, segmentedName, NIL, 0 , 0); 
+
 					Size(source, 0);
 					Address(source, 0);
 					Address(source, 0);
@@ -12160,6 +12162,19 @@ TYPE
 					Symbol(source, fieldSection, fieldSection.pc, 0);
 
 					FieldArray(fieldSection);
+
+					fieldSection := IntermediateCode.NewSection(module.allSections, Sections.ConstSection, name, NIL,TRUE);
+					HeapBlock("Heaps","SystemBlockDesc", fieldSection, 2);
+					Info(fieldSection, "HeapBlock");
+					Address(fieldSection,0); (* empty such that GC does not go on traversing *)
+					Info(fieldSection, "TypeDescriptor");
+					Address(fieldSection,0);
+
+					Info(source, "Procedure Array ref");
+					Symbol(source, fieldSection, fieldSection.pc, 0);
+
+					ProcedureArray(fieldSection);
+					
 					RETURN source;
 			END NewTypeDescriptorInfo;