[m-rev.] diff: bug fix for lcc type error

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Apr 18 00:00:26 AEST 2001


Estimated hours taken: 2

compiler/ml_code_gen.m:
	Fix a bug that occaisionally caused some type errors in the
	generated code for --high-level-code grades (gcc was just issuing
	a warning, but lcc was reporting an error message).  The bug was
	that we were using the wrong type when determining whether or
	not a cast was needed for some code emitted for `pragma c_code'
	procedures -- the type we need to use is the variable's original
	type, not the type after inlining (which can be an instance
	of the original type, if the original type is polymorphic).

Workspace: /home/venus/fjh/ws-venus/mercury
Index: compiler/ml_code_gen.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ml_code_gen.m,v
retrieving revision 1.75.2.1
diff -u -d -r1.75.2.1 ml_code_gen.m
--- compiler/ml_code_gen.m	2001/02/28 15:58:25	1.75.2.1
+++ compiler/ml_code_gen.m	2001/04/09 09:44:19
@@ -2638,7 +2638,7 @@
 			% a cast is for polymorphic types, which are
 			% `Word' in the C interface but `MR_Box' in the
 			% MLDS back-end.
-			( type_util__var(VarType, _) ->
+			( type_util__var(OrigType, _) ->
 				RHS_Cast = "(MR_Box) "
 			;
 				RHS_Cast = ""

-- 
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-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list