diff options
| author | Dan Cross <cross@gajendra.net> | 2025-07-25 11:20:03 -0400 |
|---|---|---|
| committer | Dan Cross <cross@gajendra.net> | 2025-07-25 11:20:03 -0400 |
| commit | 655f7c3184fe2f1eb039211e689c2fe037fa8320 (patch) | |
| tree | a4b1fc2d8979ffb10ad0647a394331df628ad215 /src/libmach | |
| parent | 5a9ced10ee6abaecb129b0440e211253395588c3 (diff) | |
| download | plan9port-655f7c3184fe2f1eb039211e689c2fe037fa8320.tar.gz plan9port-655f7c3184fe2f1eb039211e689c2fe037fa8320.zip | |
all: clean up misleading indentation warnings
Misleading indentation warnings are actually useful, as they
will occasionally reveal actual bugs (cf the apple `goto fail`
security bug from a few years ago). Newer versions of clang
(at least) are more aggressive about warnings in this regard,
which has exposed a few warnings that are annoying. However,
they are easy to address.
Diffstat (limited to 'src/libmach')
| -rw-r--r-- | src/libmach/dwarfpc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/libmach/dwarfpc.c b/src/libmach/dwarfpc.c index 628b3eb8..2360e5ed 100644 --- a/src/libmach/dwarfpc.c +++ b/src/libmach/dwarfpc.c @@ -47,6 +47,7 @@ dwarfpctoline(Dwarf *d, ulong pc, char **cdir, char **dir, char **file, ulong *l int i, first, op, a, l, quantum, isstmt, linebase, linerange, opcodebase, nf; char *files, *dirs, *s; DwarfBuf b; + uintptr bp; DwarfSym sym; State emit, cur, reset; uchar **f, **newf; @@ -74,9 +75,10 @@ dwarfpctoline(Dwarf *d, ulong pc, char **cdir, char **dir, char **file, ulong *l b.p = d->line.data + off; b.ep = b.p + d->line.len; b.addrsize = sym.b.addrsize; /* should i get this from somewhere else? */ + bp = (uintptr)b.p; len = dwarfget4(&b); - if(b.p==nil || b.p+len > b.ep || b.p+len < b.p){ + if(b.p==nil || b.p+len > b.ep || bp+len < bp){ fprint(2, "bad len\n"); goto bad; } @@ -89,7 +91,7 @@ dwarfpctoline(Dwarf *d, ulong pc, char **cdir, char **dir, char **file, ulong *l } len = dwarfget4(&b); - if(b.p==nil || b.p+len > b.ep || b.p+len < b.p){ + if(b.p==nil || b.p+len > b.ep || bp+len < bp){ fprint(2, "another bad len\n"); goto bad; } |
