diff: instmap.m bug fix

Fergus Henderson fjh at cs.mu.oz.au
Tue Sep 30 00:53:24 AEST 1997


instmap.m:
	Fix a bug in instmap_delta__search_var: if the instmap
	is unreachable, it should return `not_reached' rather than failing.

Index: instmap.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/instmap.m,v
retrieving revision 1.15
diff -u -r1.15 instmap.m
--- instmap.m	1997/08/25 02:24:35	1.15
+++ instmap.m	1997/08/25 07:55:01
@@ -109,8 +109,8 @@
 :- pred instmap__lookup_var(instmap, var, inst).
 :- mode instmap__lookup_var(in, in, out) is det.
 
-	% Given an instmap_delta and a variable, determine the inst
-	% of that variable.
+	% Given an instmap_delta and a variable, determine the new inst
+	% of that variable (if any).
 	%
 :- pred instmap_delta_search_var(instmap_delta, var, inst).
 :- mode instmap_delta_search_var(in, in, out) is semidet.
@@ -363,6 +363,7 @@
 		Inst = free
 	).
 
+instmap_delta_search_var(unreachable, _, not_reached).
 instmap_delta_search_var(reachable(InstMap), Var, Inst) :-
 	map__search(InstMap, Var, Inst).
 

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list