ソースを参照

Improved solution of the issue fixed in revision 8170 by simply decrementing the pc before looking it up

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@8173 8c9fc860-2736-0410-a75d-ab315db34111
negelef 7 年 前
コミット
949bf8b0ea
2 ファイル変更2 行追加2 行削除
  1. 0 2
      source/FoxIntermediateBackend.Mod
  2. 2 0
      source/Unix.Traps.Mod

+ 0 - 2
source/FoxIntermediateBackend.Mod

@@ -1591,8 +1591,6 @@ TYPE
 				CallThis(position,"Runtime","Trap",1); 
 			ELSE
 				Emit(Trap(position,trapNo));
-				(* Artificially append code to keep address of the instruction following the trap at the end of procedure within its boundary *)
-				IF trapNo = ReturnTrap THEN Emit(Trap(position,NoReturnTrap)) END;
 			END;
 		END EmitTrap;
 

+ 2 - 0
source/Unix.Traps.Mod

@@ -167,6 +167,8 @@ VAR
 			(* assume call of procedure variable with value NIL *)
 			S.GET( sp, pc );   (* get return address on top of stack *)
 		END;
+
+		IF (sig = 5) & (trapno = 3) THEN DEC (pc) END;
 		
 		IF process # NIL THEN
 			Reflection.StackTraceBack( w, pc, bp, sp, Objects.GetStackBottom( process ), TRUE, FALSE );