[m-dev.] for review: fix type_info from typeclass_info buglets

Tyson Dowd trd at cs.mu.OZ.AU
Thu Oct 14 14:54:24 AEST 1999


Hi,

A few small fixes DJ and I spotted while perusing this code.
Zoltan, you might want to make sure I've actually got this right.

===================================================================


Estimated hours taken: 0.3

Fix a few buglets with getting type_infos from typeclass_infos.

runtime/mercury_layout_util.c:
	Use MR_typeclass_info_type_info instead of
	MR_typeclass_info_superclass_info as we are generally retrieving the
	type_info.
	These macros are defined as identically so this buglet wasn't
	causing any problems.
	
runtime/mercury_stack_layout.h:
	Mention another thing that can interpret the index of a typeinfo
	within a typeclass info.


Index: runtime/mercury_layout_util.c
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_layout_util.c,v
retrieving revision 1.10
diff -u -r1.10 mercury_layout_util.c
--- mercury_layout_util.c	1999/05/27 01:01:19	1.10
+++ mercury_layout_util.c	1999/10/13 07:16:42
@@ -227,7 +227,7 @@
 			if (! *succeeded) {
 				break;
 			}
-			value = MR_typeclass_info_superclass_info(baseaddr,
+			value = MR_typeclass_info_type_info(baseaddr,
 				offset);
 			*succeeded = TRUE;
 			break;
Index: runtime/mercury_stack_layout.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_stack_layout.h,v
retrieving revision 1.28
diff -u -r1.28 mercury_stack_layout.h
--- mercury_stack_layout.h	1999/10/08 02:56:17	1.28
+++ mercury_stack_layout.h	1999/10/14 04:50:09
@@ -95,11 +95,12 @@
 **  unknown		10	(The location is not known)
 **
 ** For indirect references, the word exclusive of the tag consists of
-** (a) an integer with MR_LONG_LVAL_OFFSETBITS bits giving the index
-** of the typeinfo inside a type class info (to be interpreted by
-** private_builtin:type_info_from_typeclass_info), and (b) a MR_Long_Lval
-** value giving the location of the pointer to the type class info.
-** This MR_Long_Lval value will *not* have an indirect tag.
+** (a) an integer with MR_LONG_LVAL_OFFSETBITS bits giving the index of
+** the typeinfo inside a type class info (to be interpreted by
+** private_builtin:type_info_from_typeclass_info or
+** MR_typeclass_info_type_info) and (b) a MR_Long_Lval value giving the
+** location of the pointer to the type class info.  This MR_Long_Lval
+** value will *not* have an indirect tag.
 **
 ** This data is generated in stack_layout__represent_locn_as_int,
 ** which must be kept in sync with the constants and macros defined here.


-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't eveyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list