From 4920a0324348716d6ab5106e65508496241dc7a2 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sat, 9 May 2015 18:07:47 +0300 Subject: [PATCH] output: outmac64 -- Fix the case when first hit matches the symbol In case if we're looking up for a symbol and it's first one in symbol table we might endup with error because of using GE here (78f477b35f) ending cycle with @nearest = NULL. http://bugzilla.nasm.us/show_bug.cgi?id=3392306 Reprted-by: Benjamin Randazzo Signed-off-by: Cyrill Gorcunov --- output/outmac64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output/outmac64.c b/output/outmac64.c index c07dcbc..1d30e64 100644 --- a/output/outmac64.c +++ b/output/outmac64.c @@ -304,7 +304,7 @@ static struct symbol *get_closest_section_symbol_by_offset(uint8_t fileindex, in for (sym = syms; sym; sym = sym->next) { if ((sym->sect != NO_SECT) && (sym->sect == fileindex)) { - if ((int64_t)sym->value >= offset) + if ((int64_t)sym->value > offset) break; nearest = sym; } -- 2.4.10.GIT