[m-rev.] diff: fix inverted out-of-bounds check

Peter Wang wangp at students.csse.unimelb.edu.au
Thu Aug 9 16:08:22 AEST 2007


Estimated hours taken: 4
Branches: main

compiler/c_util.m:
	Fix an inverted out-of-bounds check in the code that prevents
	trigraph sequences from being output.

Index: compiler/c_util.m
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/compiler/c_util.m,v
retrieving revision 1.37
diff -u -r1.37 c_util.m
--- compiler/c_util.m	25 Jul 2007 06:12:18 -0000	1.37
+++ compiler/c_util.m	9 Aug 2007 06:02:13 -0000
@@ -240,7 +240,7 @@
         % "??-" gets converted to "?" "?-".
         (
             Char = '?',
-            Cur < Len + 2
+            Cur + 2 < Len
         ->
             (
                 string.unsafe_index(S, Cur + 1, '?'),
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list