Discussion:
Valgrind: r16252 - in /trunk: coregrind/m_libcprint.c include/pub_tool_basics.h
(too old to reply)
s***@valgrind.org
2017-02-20 08:07:22 UTC
Permalink
Raw Message
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

Loading...