[m-rev.] diff: IL back-end: bug fix for castclass changes

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Aug 15 04:02:21 AEST 2001


Estimated hours taken: 0.25
Branches: main

compiler/mlds_to_il.m:
	Fix a couple of bugs in my previous change where I had
	put the "castclass" instructions in the wrong place.

Workspace: /mnt/venus/home/venus/fjh/ws-venus4/mercury
Index: compiler/mlds_to_il.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_il.m,v
retrieving revision 1.71
diff -u -d -r1.71 mlds_to_il.m
--- compiler/mlds_to_il.m	2001/08/13 04:01:27	1.71
+++ compiler/mlds_to_il.m	2001/08/14 18:00:55
@@ -1841,10 +1841,11 @@
 			ClassType) } -> 
 		{ get_fieldref(DataRep, FieldNum, FieldType, ClassType,
 			FieldRef, CastClassInstrs) },
-		load(FieldRval, LoadMemRefInstrs),
-		{ StoreLvalInstrs = tree__list([
-			CastClassInstrs,
-			instr_node(stfld(FieldRef))]) } 
+		load(FieldRval, LoadMemRefInstrs0),
+		{ LoadMemRefInstrs = tree__list([
+			LoadMemRefInstrs0,
+			CastClassInstrs]) },
+		{ StoreLvalInstrs = instr_node(stfld(FieldRef)) } 
 	;
 		{ LoadMemRefInstrs = empty },
 		store(Lval, StoreLvalInstrs)
@@ -1993,8 +1994,8 @@
 		FieldRef, CastClassInstrs) },
 	load(Rval, RvalLoadInstrs),
 	{ Instrs = tree__list([
-		RvalLoadInstrs,
 		CastClassInstrs,
+		RvalLoadInstrs,
 		instr_node(stfld(FieldRef))]) }.
 
 store(mem_ref(_Rval, _Type), _Instrs, Info, Info) :- 

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