summaryrefslogtreecommitdiff
path: root/src/libmach/sym.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libmach/sym.c')
-rw-r--r--src/libmach/sym.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libmach/sym.c b/src/libmach/sym.c
index 997cc0633..ad983041a 100644
--- a/src/libmach/sym.c
+++ b/src/libmach/sym.c
@@ -1316,9 +1316,7 @@ pc2line(uvlong pc)
if(pc<currpc || pc>txtend)
return ~0;
- for(c = pcline; c < pclineend; c++) {
- if(currpc >= pc)
- return currline;
+ for(c = pcline; c < pclineend && pc <= currpc; c++) {
u = *c;
if(u == 0) {
currline += (c[1]<<24)|(c[2]<<16)|(c[3]<<8)|c[4];
@@ -1332,7 +1330,7 @@ pc2line(uvlong pc)
currpc += mach->pcquant*(u-129);
currpc += mach->pcquant;
}
- return ~0;
+ return currline;
}
/*