1
0
mirror of https://github.com/golang/go synced 2024-11-17 14:24:50 -07:00

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.
This commit is contained in:
Neven Sajko 2020-03-07 16:54:17 +00:00
parent ae3f98c51b
commit 268909130f

View File

@ -412,10 +412,10 @@ func NewFile(r io.ReaderAt) (*File, error) {
sect.Relocs[i].Type = rel.Rtype sect.Relocs[i].Type = rel.Rtype
sect.Relocs[i].Length = rel.Rsize&0x3F + 1 sect.Relocs[i].Length = rel.Rsize&0x3F + 1
if rel.Rsize&0x80 == 1 { if rel.Rsize&0x80 != 0 {
sect.Relocs[i].Signed = true sect.Relocs[i].Signed = true
} }
if rel.Rsize&0x40 == 1 { if rel.Rsize&0x40 != 0 {
sect.Relocs[i].InstructionFixed = true 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].Symbol = idxToSym[int(rel.Rsymndx)]
sect.Relocs[i].Type = rel.Rtype sect.Relocs[i].Type = rel.Rtype
sect.Relocs[i].Length = rel.Rsize&0x3F + 1 sect.Relocs[i].Length = rel.Rsize&0x3F + 1
if rel.Rsize&0x80 == 1 { if rel.Rsize&0x80 != 0 {
sect.Relocs[i].Signed = true sect.Relocs[i].Signed = true
} }
if rel.Rsize&0x40 == 1 { if rel.Rsize&0x40 != 0 {
sect.Relocs[i].InstructionFixed = true sect.Relocs[i].InstructionFixed = true
} }
} }