|
From: <sv...@va...> - 2014-11-24 17:30:09
|
Author: florian
Date: Mon Nov 24 17:30:01 2014
New Revision: 14778
Log:
As the BEAM checker correctly points out, the conditions on lines 430 and 485
are always false. I'm keeping them as assertions for documentation purposes.
The proof is left as exercise to the reader.
Hint: use conditions on lines 307 and 311 and the fact that old_len and
old_arg are both unsigned entities.
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
==============================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c (original)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c Mon Nov 24 17:30:01 2014
@@ -427,10 +427,8 @@
SSizeT needL = new_len - old_len;
vg_assert(needL > 0);
- if (needA == 0)
- goto eINVAL;
- /* VG_(am_get_advisory_client_simple) interprets zero to mean
- non-fixed, which is not what we want */
+ vg_assert(needA > 0);
+
advised = VG_(am_get_advisory_client_simple)( needA, needL, &ok );
if (ok) {
/* Fixes bug #129866. */
@@ -482,10 +480,9 @@
{
Addr needA = old_addr + old_len;
SizeT needL = new_len - old_len;
- if (needA == 0)
- goto eINVAL;
- /* VG_(am_get_advisory_client_simple) interprets zero to mean
- non-fixed, which is not what we want */
+
+ vg_assert(needA > 0);
+
advised = VG_(am_get_advisory_client_simple)( needA, needL, &ok );
if (ok) {
/* Fixes bug #129866. */
|