[m-rev.] diff: IL back-end: fix bug regarding size of char

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Jul 9 05:52:17 AEST 2001


Estimated hours taken: 0.5
Branches: main

compiler/ilasm.m:
	Fix a bug: char is ".i2", not ".i4".
	(.NET uses 16-bit, i.e. 2-byte, characters.)
	This fixes a problem that caused two error messages from `peverify'
	for the digit/3 procedure in samples/calculator.m.

Workspace: /home/administrator/ws/ws1
Index: compiler/ilasm.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/ilasm.m,v
retrieving revision 1.11
diff -u -d -r1.11 ilasm.m
--- compiler/ilasm.m	20 Jun 2001 14:16:41 -0000	1.11
+++ compiler/ilasm.m	8 Jul 2001 19:50:26 -0000
@@ -675,9 +675,9 @@
 output_simple_type_opcode(float64) --> io__write_string("r8").
 output_simple_type_opcode(native_float) --> 
 	{ error("unable to create opcode for native_float") }.
-		% XXX should i4 be used for bool and char? 
+		% XXX should i4 be used for bool? 
 output_simple_type_opcode(bool) --> io__write_string("i4").
-output_simple_type_opcode(char) --> io__write_string("i4").
+output_simple_type_opcode(char) --> io__write_string("i2").
 
 	% all reference types use "ref" as their opcode.
 output_simple_type_opcode(refany) --> io__write_string("ref").

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  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