diff: bug fixes for ML_expand.

Tyson Dowd trd at cs.mu.OZ.AU
Thu Jun 11 17:56:32 AEST 1998


Hi,

This should fix the problems with last nights build.

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


Estimated hours taken: 2

Fix some bugs in ML_expand that were triggered when writing out
.opt files with terminiation analysis on.

library/std_util.m:
	Initialize functors_indicator (it was being used uninitialized,
	so it would indentify a univ as a complicated constant...

	Use strip_tag() instead of body() (avoids use of entry_tag, which
	is also uninitialized.

	Use data_word for enumerations, not data_value (cut and paste
	error).

	Set type_info_vector to NULL for enumerations.


Index: library/std_util.m
===================================================================
RCS file: /home/staff/zs/imp/mercury/library/std_util.m,v
retrieving revision 1.121
diff -u -t -r1.121 std_util.m
--- std_util.m	1998/06/10 06:55:25	1.121
+++ std_util.m	1998/06/11 06:56:32
@@ -2183,19 +2183,21 @@
     base_type_layout_entry = MR_BASE_TYPEINFO_GET_TYPELAYOUT_ENTRY(
         base_type_info, data_tag);
     base_type_functors = MR_BASE_TYPEINFO_GET_TYPEFUNCTORS(base_type_info);
+    functors_indicator = MR_TYPEFUNCTORS_INDICATOR(base_type_functors);
 
-    entry_value = body(base_type_layout_entry, entry_tag);
 
-    data_rep = MR_categorize_data(functors_indicator,
-        base_type_layout_entry);
+    data_rep = MR_categorize_data(functors_indicator, base_type_layout_entry);
 
+    entry_value = strip_tag(base_type_layout_entry);
+
     switch(data_rep) {
 
         case MR_DATAREP_ENUM:
             info->functor = MR_TYPELAYOUT_ENUM_VECTOR_FUNCTOR_NAME(
-                entry_value, data_value);
+                entry_value, data_word);
             info->arity = 0;
             info->argument_vector = NULL;
+            info->type_info_vector = NULL;      
             break;
 
         case MR_DATAREP_COMPLICATED_CONST:


-- 
       Tyson Dowd           # There isn't any reason why Linux can't be
                            # implemented as an enterprise computing solution.
     trd at cs.mu.oz.au        # Find out what you've been missing while you've
http://www.cs.mu.oz.au/~trd # been rebooting Windows NT. -- InfoWorld, 1998.



More information about the developers mailing list