diff options
| author | Neven Sajko <nsajko@gmail.com> | 2020-03-07 17:23:20 +0000 |
|---|---|---|
| committer | Ian Lance Taylor <iant@golang.org> | 2020-03-09 18:07:53 +0000 |
| commit | b559a173f9f187e1185f8de00a9cc1f5b05aceef (patch) | |
| tree | 316371bdf32d38b9be5ee3a10bbb7d4e0b9c96e6 /src | |
| parent | 43c6ada84c6ef47e3b61646d2f2e7f6b7264929d (diff) | |
| download | go-b559a173f9f187e1185f8de00a9cc1f5b05aceef.tar.xz | |
internal/xcoff: fix wrong bit masking comparisons
I do not know much about xcoff, but this was probably the intended
behavior. (The comparison is tautologically false, as is.)
Also note: does any other code even depend on the changed code existing?
Maybe it should just be removed, as I did not find any uses of fields
that are written to if the branch condition tests true.
Change-Id: I1f23d33764df40e87f3e64460d63f6efc51a2a78
GitHub-Last-Rev: 268909130fd7fb3993fcf7004143ec48dbfe5e2a
GitHub-Pull-Request: golang/go#37733
Reviewed-on: https://go-review.googlesource.com/c/go/+/222478
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Clément Chigot <clement.chigot%atos.net@gtempaccount.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/internal/xcoff/file.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/internal/xcoff/file.go b/src/internal/xcoff/file.go index 66b5391d58..05e4fd555c 100644 --- a/src/internal/xcoff/file.go +++ b/src/internal/xcoff/file.go @@ -412,10 +412,10 @@ func NewFile(r io.ReaderAt) (*File, error) { sect.Relocs[i].Type = rel.Rtype sect.Relocs[i].Length = rel.Rsize&0x3F + 1 - if rel.Rsize&0x80 == 1 { + if rel.Rsize&0x80 != 0 { sect.Relocs[i].Signed = true } - if rel.Rsize&0x40 == 1 { + if rel.Rsize&0x40 != 0 { sect.Relocs[i].InstructionFixed = true } @@ -428,10 +428,10 @@ func NewFile(r io.ReaderAt) (*File, error) { sect.Relocs[i].Symbol = idxToSym[int(rel.Rsymndx)] sect.Relocs[i].Type = rel.Rtype sect.Relocs[i].Length = rel.Rsize&0x3F + 1 - if rel.Rsize&0x80 == 1 { + if rel.Rsize&0x80 != 0 { sect.Relocs[i].Signed = true } - if rel.Rsize&0x40 == 1 { + if rel.Rsize&0x40 != 0 { sect.Relocs[i].InstructionFixed = true } } |
