[m-dev.] for review: .agc fixes needed to compile runtime
Fergus Henderson
fjh at cs.mu.OZ.AU
Thu Nov 9 00:07:21 AEDT 2000
My review missed some bugs in this change, which caused it to break
the tests/hard_coded/copy_pred.m test case.
On 06-Nov-2000, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> +++ runtime/mercury_deep_copy_body.h 2000/10/17 04:31:20
> @@ -397,6 +397,8 @@
> **
> ** Their type-infos have a pointer to type_ctor_info for
> ** pred/0, arity, and then argument typeinfos.
> + **
> + ** XXX pred needs to handle traversals.
> */
> if (in_range(data_value)) {
> MR_Unsigned args, i;
> @@ -409,6 +411,9 @@
> closure_layout = old_closure->MR_closure_layout;
> args = old_closure->MR_closure_num_hidden_args;
>
> + /* get number of curried arguments */
> + args = data_value[0];
That is a bug. It looks like it was probably a cvs merge error.
I'll delete those two lines.
> @@ -438,6 +443,8 @@
>
> new_data = (MR_Word) new_closure;
> leave_forwarding_pointer(data_ptr, new_data);
> + } else if (in_range(data_value)) {
> + fatal_error("sorry, unimplemented: traversal of closures");
That code there is unreachable, since the `if' already tested
`in_range(data_value)'. Did you mean to write `in_traversal_range'?
I'll assume so.
I'll go ahead and commit this change.
Estimated hours taken: 0.5
runtime/mercury_deep_copy_body.h:
Fix a couple of bugs in trd's recent change:
- it was overwriting the correct value of `args'
- one of the tests for `in_traversal_range' was
mistakenly testing `in_range' instead.
Workspace: /home/pgrad/fjh/ws/hg
Index: runtime/mercury_deep_copy_body.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_deep_copy_body.h,v
retrieving revision 1.28
diff -u -d -r1.28 mercury_deep_copy_body.h
--- runtime/mercury_deep_copy_body.h 2000/11/07 08:58:33 1.28
+++ runtime/mercury_deep_copy_body.h 2000/11/08 13:04:47
@@ -411,9 +411,6 @@
closure_layout = old_closure->MR_closure_layout;
args = old_closure->MR_closure_num_hidden_args;
- /* get number of curried arguments */
- args = data_value[0];
-
/* create new closure */
incr_saved_hp(LVALUE_CAST(MR_Word, new_closure), args + 3);
@@ -443,7 +440,7 @@
new_data = (MR_Word) new_closure;
leave_forwarding_pointer(data_ptr, new_data);
- } else if (in_range(data_value)) {
+ } else if (in_traverse_range(data_value)) {
fatal_error("sorry, unimplemented: traversal of closures");
} else {
new_data = data;
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
| of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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