Bug fix in passes_aux.m\

Andrew Bromage bromage at cs.mu.oz.au
Fri May 16 15:17:13 AEST 1997


G'day.

This change has been committed.

There is no regression test; the bug was picked up by the new
mode checker.

Cheers,
Andrew Bromage
--------8<---CUT HERE---8<--------
Approximate hours taken: 0.2

Bug fix for problem where process_all_nonimported_procs/5 was
clobbering the pred_table between passes.

compiler/passes_aux.m:
	Rather than fill in the pred_table and proc_table that we
	had before running a pass, get them from the possibly
	amended module_info.

Index: passes_aux.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/passes_aux.m,v
retrieving revision 1.17
diff -u -r1.17 passes_aux.m
--- passes_aux.m	1997/04/07 05:39:40	1.17
+++ passes_aux.m	1997/05/16 04:17:02
@@ -189,9 +189,17 @@
 		State9 = State0
 	),
 
-	map__det_update(Procs0, ProcId, Proc, Procs),
-	pred_info_set_procedures(Pred0, Procs, Pred),
-	map__det_update(Preds0, PredId, Pred, Preds),
+	% If the pass changed the module_info, it may have changed
+	% the pred table or the proc table for this pred_id.  Don't
+	% take any chances.
+
+	module_info_preds(ModuleInfo8, Preds8),
+	map__lookup(Preds8, PredId, Pred8),
+	pred_info_procedures(Pred8, Procs8),
+
+	map__det_update(Procs8, ProcId, Proc, Procs),
+	pred_info_set_procedures(Pred8, Procs, Pred),
+	map__det_update(Preds8, PredId, Pred, Preds),
 	module_info_set_preds(ModuleInfo8, Preds, ModuleInfo9),
 
 	process_nonimported_procs(ProcIds, PredId, Task1, Task,



More information about the developers mailing list