for review: fix bug in MR_based_stackvar

Mark Anthony BROWN dougl at cs.mu.OZ.AU
Mon Nov 23 17:42:10 AEDT 1998


Hi,

Could somebody review this near-trivial change, please?


Estimated hours taken: 1

runtime/mercury_stacks.h:
	Add parentheses around a parameter of MR_based_stackvar, to
	avoid errors when the argument is an expression such as
	``slot + 1''.


Index: runtime/mercury_stacks.h
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/mercury_stacks.h,v
retrieving revision 1.13
diff -u -t -r1.13 mercury_stacks.h
--- mercury_stacks.h	1998/11/11 02:14:18	1.13
+++ mercury_stacks.h	1998/11/23 02:35:25
@@ -17,7 +17,7 @@
 
 /* DEFINITIONS FOR MANIPULATING THE DET STACK */
 
-#define MR_based_stackvar(base_sp, n)   ((base_sp)[-n])
+#define MR_based_stackvar(base_sp, n)   ((base_sp)[-(n)])
 #define MR_stackvar(n)                  MR_based_stackvar(MR_sp, n)
 
 #define incr_sp_push_msg(n, msg)                                \



More information about the developers mailing list