[m-dev.] trivial diff: avoid MLDS code gen problem

Peter Ross petdr at miscrit.be
Fri Oct 20 21:12:14 AEDT 2000


Hi,


===================================================================


Estimated hours taken: 2

compiler/mlds_to_il.m:
	Avoid a code generation problem in the MLDS code generator,
	where terms which are represented by static constants in the
	condition of an if-then-else is used in the then branch.


Index: compiler/mlds_to_il.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_il.m,v
retrieving revision 1.1
diff -u -r1.1 mlds_to_il.m
--- compiler/mlds_to_il.m	2000/10/14 04:00:17	1.1
+++ compiler/mlds_to_il.m	2000/10/20 10:07:30
@@ -2393,16 +2393,16 @@
 		FieldRef = make_fieldref(ILType, ObjClassName,
 			MangledName),
 		( 
-			ILType = il_envptr_type, 
-			ClassName = il_envptr_class_name
+			ILType = il_envptr_type
 		->
+			ClassName = il_envptr_class_name,
 			Instrs = [ldarg(index(0)),
 				newobj_constructor(ClassName),
 				stfld(FieldRef)]
 		;
-			ILType = il_commit_type,
-			ClassName = il_commit_class_name
+			ILType = il_commit_type
 		->
+			ClassName = il_commit_class_name,
 			Instrs = [ldarg(index(0)),
 				newobj_constructor(ClassName),
 				stfld(FieldRef)]

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