Quantcast

Valgrind: r16252 - in /trunk: coregrind/m_libcprint.c include/pub_tool_basics.h

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Valgrind: r16252 - in /trunk: coregrind/m_libcprint.c include/pub_tool_basics.h

svn-2
Author: iraisr
Date: Mon Feb 20 08:07:21 2017
New Revision: 16252

Log:
Fix sr_EQ() comparison on Solaris syscall failure
On rare occasions, garbage is found in sr1._val2
while sr2._val2 contains 0.

Modified:
    trunk/coregrind/m_libcprint.c
    trunk/include/pub_tool_basics.h

Modified: trunk/coregrind/m_libcprint.c
==============================================================================
--- trunk/coregrind/m_libcprint.c (original)
+++ trunk/coregrind/m_libcprint.c Mon Feb 20 08:07:21 2017
@@ -1168,7 +1168,7 @@
    return buf;
 }
 
-#elif defined(VGO_darwin) || (VGO_solaris)
+#elif defined(VGO_darwin) || defined(VGO_solaris)
 
 const HChar *VG_(sr_as_string) ( SysRes sr )
 {

Modified: trunk/include/pub_tool_basics.h
==============================================================================
--- trunk/include/pub_tool_basics.h (original)
+++ trunk/include/pub_tool_basics.h Mon Feb 20 08:07:21 2017
@@ -359,8 +359,8 @@
 static inline Bool sr_EQ ( UInt sysno, SysRes sr1, SysRes sr2 ) {
    /* sysno is ignored for Solaris */
    return sr1._val == sr2._val
-       && sr1._val2 == sr2._val2
-       && sr1._isError == sr2._isError;
+       && sr1._isError == sr2._isError
+       && (!sr1._isError) ? (sr1._val2 == sr2._val2) : True;
 }
 
 #else


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/valgrind-developers
Loading...