]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
As the BEAM checker correctly points out, the conditions on lines 430 and 485
authorFlorian Krohm <florian@eich-krohm.de>
Mon, 24 Nov 2014 17:30:01 +0000 (17:30 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Mon, 24 Nov 2014 17:30:01 +0000 (17:30 +0000)
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.

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

coregrind/m_syswrap/syswrap-generic.c

index 94450110233f2f241df05237f35a32a96fef2609..56d5718a5e10e5e0aba30149737e63474fb9ec5a 100644 (file)
@@ -427,10 +427,8 @@ SysRes do_mremap( Addr old_addr, SizeT old_len,
    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 @@ SysRes do_mremap( Addr old_addr, SizeT old_len,
    {
    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. */