[m-dev.] diff: check for unbound inst vars

Fergus Henderson fjh at cs.mu.oz.au
Mon Sep 29 16:45:07 AEST 1997


Oops, I forgot to include one file that I had changed in the
diff:

compiler/mode_util.m:
	In propagate_types_into_modes, don't abort for inst_var(_) insts;
	the check for unbound inst variables has to be done _after_
	propagate_types_into_modes, so we have to allow them here.

Index: mercury_sparc/compiler/mode_util.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/compiler/mode_util.m,v
retrieving revision 1.100
diff -u -r1.100 mode_util.m
--- mode_util.m	1997/09/14 09:24:28	1.100
+++ mode_util.m	1997/09/27 19:57:14
@@ -637,8 +637,7 @@
 
 propagate_ctor_info(not_reached, _Type, _Constructors, _ModuleInfo,
 		not_reached).
-propagate_ctor_info(inst_var(_), _, _, _, _) :-
-	error("propagate_ctor_info: unbound inst var").
+propagate_ctor_info(inst_var(V), _, _, _, inst_var(V)).
 propagate_ctor_info(abstract_inst(Name, Args), _, _, _,
 		abstract_inst(Name, Args)).	% XXX loses info
 propagate_ctor_info(defined_inst(InstName), Type, Ctors, ModuleInfo, Inst) :-
@@ -702,8 +701,7 @@
 		Modes = Modes0
 	).
 propagate_ctor_info_lazily(not_reached, _Type, _, _ModuleInfo, not_reached).
-propagate_ctor_info_lazily(inst_var(_), _, _, _, _) :-
-	error("propagate_ctor_info_lazily: unbound inst var").
+propagate_ctor_info_lazily(inst_var(Var), _, _, _, inst_var(Var)).
 propagate_ctor_info_lazily(abstract_inst(Name, Args), _, _, _,
 		abstract_inst(Name, Args)).	% XXX loses info
 propagate_ctor_info_lazily(defined_inst(InstName0), Type0, Subst, _,

-- 
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