For review : bug fix in mercury_deep_copy.c
Oliver Hutchison
ohutch at students.cs.mu.OZ.AU
Mon Mar 23 13:24:58 AEDT 1998
Tyson should have a look at this one.
Estimated hours taken: 0.1
runtime/mercury_deep_copy.c:
Fix bug in copying of array types that caused the elements of
arrays to be shallow copied.
Index: mercury_deep_copy.c
===================================================================
RCS file: /home/staff/zs/imp/mercury/runtime/mercury_deep_copy.c,v
retrieving revision 1.4
diff -u -r1.4 mercury_deep_copy.c
--- mercury_deep_copy.c 1997/12/30 16:06:04 1.4
+++ mercury_deep_copy.c 1998/03/23 02:16:36
@@ -195,8 +188,11 @@
array_size = old_array->size;
new_array = MR_make_array(array_size);
new_array->size = array_size;
for (i = 0; i < array_size; i++) {
- new_array->elements[i] = old_array->elements[i];
+ new_array->elements[i] = deep_copy_arg(
+ old_array->elements[i], type_info,
+ (Word *) 1, lower_limit, upper_limit);
}
new_data = (Word) new_array;
} else {
More information about the developers
mailing list