This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[PATCH 2/2] Fix some errors which cause unnecessary rebases
- From: Jon Turney <jon dot turney at dronecode dot org dot uk>
- To: cygwin-apps at cygwin dot com
- Cc: Jon Turney <jon dot turney at dronecode dot org dot uk>
- Date: Fri, 9 Feb 2018 11:59:41 +0000
- Subject: [PATCH 2/2] Fix some errors which cause unnecessary rebases
- Authentication-results: sourceware.org; auth=none
- References: <20180209115941.512448-1-jon.turney@dronecode.org.uk>
Also add some parentheses for clarity
---
rebase.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/rebase.c b/rebase.c
index 0aad1b2..1c8fe7a 100644
--- a/rebase.c
+++ b/rebase.c
@@ -750,8 +750,8 @@ merge_image_info ()
}
/* However, if the DLL got bigger and doesn't fit into its slot
anymore, rebase this DLL from scratch. */
- if (i + 1 < img_info_rebase_start
- && cur_base + slot_size + offset >= img_info_list[i + 1].base)
+ if ((i + 1 < img_info_rebase_start)
+ && (cur_base + slot_size + offset > img_info_list[i + 1].base))
{
img_info_list[i].base = 0;
if (verbose)
@@ -759,8 +759,8 @@ merge_image_info ()
}
/* Does the previous DLL reach into the address space of this
DLL? This happens if the previous DLL is not rebaseable. */
- else if (i > 0 && cur_base < img_info_list[i - 1].base
- + img_info_list[i + 1].slot_size)
+ else if ((i > 0) && (cur_base < img_info_list[i - 1].base
+ + img_info_list[i - 1].slot_size))
{
img_info_list[i].base = 0;
if (verbose)
@@ -768,8 +768,8 @@ merge_image_info ()
}
/* Does the file match the base address requirements? If not,
rebase from scratch. */
- else if ((down_flag && cur_base + slot_size + offset >= image_base)
- || (!down_flag && cur_base < image_base))
+ else if ((down_flag && (cur_base + slot_size + offset > image_base))
+ || (!down_flag && (cur_base < image_base)))
{
img_info_list[i].base = 0;
if (verbose)
--
2.16.1