Bläddra i källkod

patched problem with offset fixup when @sym is used

git-svn-id: https://svn-dept.inf.ethz.ch/svn/lecturers/a2/trunk@8926 8c9fc860-2736-0410-a75d-ab315db34111
felixf 6 år sedan
förälder
incheckning
14ac247369
1 ändrade filer med 2 tillägg och 9 borttagningar
  1. 2 9
      source/FoxAMD64Assembler.Mod

+ 2 - 9
source/FoxAMD64Assembler.Mod

@@ -1531,6 +1531,7 @@ TYPE
 						NextSymbol;
 						IF symbol # symIdent THEN Error("identifier missing") END;
 						GetOffsetFixup (idents, ofs);
+						ofs.sizeInBytes := emitter.cpuBits; (* refer to address, not variable *) 
 						NextSymbol;
 						IF symbol = symPlus THEN
 							NextSymbol;
@@ -1710,16 +1711,8 @@ TYPE
 					SetSymbol(operand,name,0,0,0);
 				ELSE
 					InitMem(operand,IntermediateCode.Bits32,InstructionSet.regRBP,(scopeSymbol.offsetInBits DIV 8)); (* or immediate ?? *)					
-					
-					(*SetSymbol(operand,name,0,0,0);*)
-				(*ELSE
-					Error("direct access to local variable offset forbidden");
-				*)
 				END;
 				operand.sizeInBytes := SHORTINT(scopeSymbol.type.resolved.sizeInBits DIV 8);
-				(*
-				operand.sizeInBytes := emitter.cpuBits;
-				*)
 			END GetOffsetFixup;
 
 			(* the following procedure is used to adapt sizes for relative jumps *)
@@ -2781,4 +2774,4 @@ TYPE
 		END;
 	END FoxAMD64Assembler.
 
-OCAMD64Assembler.Test ~
+System.FreeDownTo FoxAMD64Assembler ~