[m-rev.] diff: fix another reserved addr RTTI bug

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Oct 27 19:02:22 AEDT 2002


Estimated hours taken: 0.5
Branches: main

Fix another bug with Zoltan's recent RTTI changes that broke things
with `--num-reserved-addresses 1'.

compiler/rtti_to_mlds.m:
	Set the is_res field of the MR_MaybeResAddrFunctorDesc to false
	rather than true for non-reserved functors.
	Also, handle boolean constants properly.

Workspace: /c/fjh/ws/2/mercury
Index: compiler/rtti_to_mlds.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/rtti_to_mlds.m,v
retrieving revision 1.35
diff -u -d -r1.35 rtti_to_mlds.m
--- compiler/rtti_to_mlds.m	27 Oct 2002 04:16:48 -0000	1.35
+++ compiler/rtti_to_mlds.m	27 Oct 2002 08:02:28 -0000
@@ -778,8 +778,8 @@
 		Name = ResFunctor ^ res_name,
 		Init = init_struct([
 			gen_init_string(Name),
-			gen_init_int(0),
-			gen_init_builtin_const("MR_TRUE"),
+			gen_init_int(0),    % arity=0
+			gen_init_bool(yes), % is_reserved = true
 			gen_init_rtti_name(ModuleName, RttiTypeCtor,
 				maybe_res_functor_rtti_name(MaybeResFunctor))
 		])
@@ -789,7 +789,7 @@
 		Init = init_struct([
 			gen_init_string(Name),
 			gen_init_int(DuFunctor ^ du_orig_arity),
-			gen_init_builtin_const("MR_TRUE"),
+			gen_init_bool(no), % is_reserved = false
 			gen_init_rtti_name(ModuleName, RttiTypeCtor,
 				maybe_res_functor_rtti_name(MaybeResFunctor))
 		])
@@ -1087,6 +1087,11 @@
 :- func gen_init_int(int) = mlds__initializer.
 
 gen_init_int(Int) = init_obj(const(int_const(Int))).
+
+:- func gen_init_bool(bool) = mlds__initializer.
+
+gen_init_bool(no) = init_obj(const(false)).
+gen_init_bool(yes) = init_obj(const(true)).
 
 :- func gen_init_boxed_int(int) = mlds__initializer.
 
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list