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

allocate register after evaluation for condition to value (otherwise unused register may be stored on stack, which leads to problems with backend)

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8395 8c9fc860-2736-0410-a75d-ab315db34111
felixf 7 жил өмнө
parent
commit
1529e958fe

+ 1 - 1
source/FoxIntermediateBackend.Mod

@@ -3513,8 +3513,8 @@ TYPE
 			InitOperand(op,ModeValue);
 			InitOperand(op,ModeValue);
 			trueL := NewLabel();
 			trueL := NewLabel();
 			exitL := NewLabel();
 			exitL := NewLabel();
-			IntermediateCode.InitRegister(op.op,IntermediateCode.GetType(system,x.type),IntermediateCode.GeneralPurposeRegister,AcquireRegister(IntermediateCode.GetType(system,x.type),IntermediateCode.GeneralPurposeRegister));
 			Condition(x,trueL,TRUE);
 			Condition(x,trueL,TRUE);
+			IntermediateCode.InitRegister(op.op,IntermediateCode.GetType(system,x.type),IntermediateCode.GeneralPurposeRegister,AcquireRegister(IntermediateCode.GetType(system,x.type),IntermediateCode.GeneralPurposeRegister));
 			Emit(Mov(position,op.op,false));
 			Emit(Mov(position,op.op,false));
 			BrL(exitL);
 			BrL(exitL);
 			SetLabel(trueL);
 			SetLabel(trueL);