[m-dev.] for review: fix a bug in the handling of type_desc
Thomas Conway
conway at cs.mu.OZ.AU
Wed Jan 17 11:19:23 AEDT 2001
Hi
Zoltan and Fergus, can you verify that this is correct?
The test cases that were aborting on arrays of univs in the debug
grades were doing so because in asm_fast.gc, the type specific
unification pred was being called for type_desc, but in debug
grade, generic unify was being called. The code in the latter
was treating type_desc as c_pointer which is wrong.
--
Thomas Conway Mercurian )O+
<conway at cs.mu.oz.au> Every sword has two edges.
Fix a bug in the representation of type_desc which meant that
comparison and equality on them didn't work in some cases.
library/std_util.m:
Use MR_TYPECTOR_REP_TYPEINFO rather than MR_TYPECTOR_REP_C_POINTER
to denote how type_desc should be handled in generic unifications
and comparisons.
Index: std_util.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/std_util.m,v
retrieving revision 1.217
diff -u -r1.217 std_util.m
--- std_util.m 2001/01/09 23:30:18 1.217
+++ std_util.m 2001/01/16 23:47:48
@@ -1238,7 +1238,7 @@
#else
MR_DEFINE_BUILTIN_TYPE_CTOR_INFO(std_util, type_desc, 0,
- MR_TYPECTOR_REP_C_POINTER);
+ MR_TYPECTOR_REP_TYPEINFO);
MR_define_extern_entry(mercury____Unify___std_util__type_desc_0_0);
MR_define_extern_entry(mercury____Compare___std_util__type_desc_0_0);
@@ -1301,7 +1301,7 @@
:- pragma foreign_code("MC++", "
MR_DEFINE_BUILTIN_TYPE_CTOR_INFO(std_util, type_desc, 0,
- MR_TYPECTOR_REP_C_POINTER)
+ MR_TYPECTOR_REP_TYPEINFO)
static int MR_compare_type_info(MR_TypeInfo x, MR_TypeInfo y) {
mercury::runtime::Errors::SORRY(""foreign code for this function"");
--------------------------------------------------------------------------
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