]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Only consider two error contexts as equivalent if the contexts have another
authorBart Van Assche <bvanassche@acm.org>
Fri, 31 Jul 2009 08:45:02 +0000 (08:45 +0000)
committerBart Van Assche <bvanassche@acm.org>
Fri, 31 Jul 2009 08:45:02 +0000 (08:45 +0000)
type than "data race error" or if both data race error contexts refer to the
same access type and the same access size.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@10675

drd/drd_error.c

index 899a5fb818ead748eb562c26102071dd137fed06..b7a5dd76827b10ff2c6b211fbf16ebc927311c46 100644 (file)
@@ -196,11 +196,20 @@ void drd_report_data_race(Error* const err, const DataRaceErrInfo* const dri)
  */
 static Bool drd_compare_error_contexts(VgRes res, Error* e1, Error* e2)
 {
-   /*
-    * Since e1 and e2 have the same error kind and the same error contexts,
-    * no further comparisons have to be performed. Just return true.
-    */
-   return True;
+   tl_assert(VG_(get_error_kind)(e1) == VG_(get_error_kind)(e2));
+
+   switch (VG_(get_error_kind)(e1))
+   {
+   case DataRaceErr:
+   {
+      const DataRaceErrInfo* const dri1 = VG_(get_error_extra)(e1);
+      const DataRaceErrInfo* const dri2 = VG_(get_error_extra)(e2);
+      return dri1->access_type == dri2->access_type
+            && dri1->size == dri2->size;
+   }
+   default:
+      return True;
+   }
 }
 
 /**