[m-rev.] for review: fix an error in stack_opt.m

Peter Wang wangp at students.cs.mu.OZ.AU
Thu Feb 17 17:33:12 AEDT 2005


A test case for this is mmc --optimize-saved-vars prog_io.m

Estimated hours taken: 0.5
Branches: main, release

compiler/stack_opt.m:
	Avoid aborting on the error "record_decisions_at_call_site: no
	save map" when `record_decisions_at_call_site' reaches an
	unsafe_cast.

Index: stack_opt.m
===================================================================
RCS file: /home/mercury1/repository/mercury/compiler/stack_opt.m,v
retrieving revision 1.14
diff -u -r1.14 stack_opt.m
--- stack_opt.m	21 Jan 2005 03:27:48 -0000	1.14
+++ stack_opt.m	17 Feb 2005 06:22:22 -0000
@@ -1812,9 +1812,15 @@
 
 record_decisions_in_goal(Goal0, Goal, VarInfo0, VarInfo,
 		VarRename0, VarRename, InsertMap) :-
-	Goal0 = generic_call(_,_,_,_) - _,
+	Goal0 = generic_call(GenericCall, _ , _, _) - _,
+	% unsafe_casts are generated inline.
+	( GenericCall = unsafe_cast ->
+		MustHaveMap = no
+	;
+		MustHaveMap = yes
+	),
 	record_decisions_at_call_site(Goal0, Goal, VarInfo0, VarInfo,
-		VarRename0, VarRename, yes, InsertMap).
+		VarRename0, VarRename, MustHaveMap, InsertMap).
 
 record_decisions_in_goal(Goal0, Goal, VarInfo0, VarInfo, VarRename0, VarRename,
 		InsertMap) :-


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