[m-rev.] [reuse] diff: bug fix for delete_object

Peter Ross peter.ross at miscrit.be
Fri Mar 30 23:41:29 AEST 2001


Hi,


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


Estimated hours taken: 0.25
Branches: reuse

compiler/mlds_to_c.m:
    Output a do-nothing statement if the cell-cache isn't turned on for
    the delete_object instruction.  This avoids generating incorrect C
    when the delete_object call is the only statement in the body of an
    if.


Index: mlds_to_c.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/mlds_to_c.m,v
retrieving revision 1.55.2.13
diff -u -r1.55.2.13 mlds_to_c.m
--- mlds_to_c.m	2001/03/23 17:18:51	1.55.2.13
+++ mlds_to_c.m	2001/03/30 13:37:26
@@ -2392,15 +2392,16 @@
 	%
 mlds_output_atomic_stmt(Indent, _FuncInfo, delete_object(Rval, Size), _) -->
 	globals__io_lookup_bool_option(cell_cache, CellCache),
+	mlds_indent(Indent),
 	( { CellCache = yes } ->
-		mlds_indent(Indent),
 		io__write_string("MR_compile_time_gc("),
 		mlds_output_rval(Rval),
 		io__write_string(", "),
 		io__write_int(Size),
 		io__write_string(");\n")
 	;
-		[]
+		% Output something as it may be required for the body of an if
+		io__write_string("(void) 0;\n")
 	).
 
 mlds_output_atomic_stmt(Indent, FuncInfo, NewObject, Context) -->

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