aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libmach/sym.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libmach/sym.c b/src/libmach/sym.c
index 7953019b..8347630c 100644
--- a/src/libmach/sym.c
+++ b/src/libmach/sym.c
@@ -295,7 +295,7 @@ findsym(Loc loc, uint class, Symbol *s)
l.addr = loc.addr - p->base;
if((t = ffindsym(p, l, CANY)) != nil){
d = l.addr - t->loc.addr;
- if(d < 4096)
+ if(0 <= d && d < 4096)
if(best == nil || d < bestd){
best = t;
bestp = p;