[m-dev.] diff: fix bug with deep_copy and boxed floats

Fergus Henderson fjh at cs.mu.OZ.AU
Sun Nov 12 13:40:59 AEDT 2000


Estimated hours taken: 0.75

runtime/mercury_deep_copy_body.h:
	Fix a bug that broke tests/hard_coded/typeclasses/existential_rtti
	in grade hlc.gc.par: deep_copy was not handling boxed floats correctly.
	It was boxing and then unboxing them, rather than doing vice versa.

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.29
diff -u -d -r1.29 mercury_deep_copy_body.h
--- runtime/mercury_deep_copy_body.h	2000/11/08 13:08:13	1.29
+++ runtime/mercury_deep_copy_body.h	2000/11/12 02:29:33
@@ -349,7 +349,7 @@
 
                 if (in_range(data_value)) {
                     restore_transient_hp();
-                    new_data = word_to_float(float_to_word(data));
+                    new_data = float_to_word(word_to_float(data));
                     save_transient_hp();
                     leave_forwarding_pointer(data_ptr, new_data);
                 } else {

-- 
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