This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix a typo in sparseset_pop


Hi

The following patch fixes an obvious wrong index used to access the
dense array. The patch has passed the bootstrap and regression tests
on x86-64.

OK for trunk?

thanks
Carrot


2014-02-23  Guozhi Wei  <carrot@google.com>

        * sparseset.h (sparseset_pop): Fix the wrong index.


Index: sparseset.h
===================================================================
--- sparseset.h (revision 208039)
+++ sparseset.h (working copy)
@@ -177,7 +177,7 @@
   gcc_checking_assert (mem != 0);

   s->members = mem - 1;
-  return s->dense[mem];
+  return s->dense[s->members];
 }

 static inline void


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]