Browse Source

Patch for FoxTest: command loader reports trap to Modules.Mod when body trapped

git-svn-id: https://svn.inf.ethz.ch/svn/lecturers/a2/trunk@6855 8c9fc860-2736-0410-a75d-ab315db34111
felixf 9 years ago
parent
commit
d4c511a4a6
1 changed files with 4 additions and 3 deletions
  1. 4 3
      source/GenericLoader.Mod

+ 4 - 3
source/GenericLoader.Mod

@@ -8,7 +8,8 @@ CONST
 	Ok = 0;
 	Ok = 0;
 	LinkerError=3400;
 	LinkerError=3400;
 	FileNotFound = 3401;
 	FileNotFound = 3401;
-
+	CommandTrapped* = 3904; (* cf module Commands *) 
+	
 	SupportOldObjectFileFormat = FALSE;
 	SupportOldObjectFileFormat = FALSE;
 	TraceLoading = FALSE;
 	TraceLoading = FALSE;
 TYPE
 TYPE
@@ -589,6 +590,7 @@ VAR
 		END
 		END
 	END SelectionSort;
 	END SelectionSort;
 	
 	
+	
 	PROCEDURE LoadObj*(CONST name, fileName: ARRAY OF CHAR;  VAR res: LONGINT; VAR msg: ARRAY OF CHAR): Modules.Module;
 	PROCEDURE LoadObj*(CONST name, fileName: ARRAY OF CHAR;  VAR res: LONGINT; VAR msg: ARRAY OF CHAR): Modules.Module;
 	TYPE Body=PROCEDURE;
 	TYPE Body=PROCEDURE;
 	VAR
 	VAR
@@ -641,8 +643,6 @@ VAR
 					Here this is made sure to enter the module in the data structure before returning it. 
 					Here this is made sure to enter the module in the data structure before returning it. 
 				*) 
 				*) 
 				Modules.Initialize(module);
 				Modules.Initialize(module);
-
-
 			ELSE module := NIL; res := LinkerError; stringWriter.Update; stringWriter.Get(msg);
 			ELSE module := NIL; res := LinkerError; stringWriter.Update; stringWriter.Get(msg);
 
 
 			END;
 			END;
@@ -653,6 +653,7 @@ VAR
 		IF (res # Ok) & (res # FileNotFound) THEN D.String(msg);D.Ln END;
 		IF (res # Ok) & (res # FileNotFound) THEN D.String(msg);D.Ln END;
 		RETURN module
 		RETURN module
 	FINALLY
 	FINALLY
+		res := CommandTrapped;
 		RETURN NIL
 		RETURN NIL
 	END LoadObj;
 	END LoadObj;