Re: Fix undefined shift overflow

2016-02-03 Thread Nick Clifton
Hi Michael, This idiom also appears in newlib and in various versions of GDB and associated codebases. I'm not sure how this maps to actual development repos. Well GDB shares a repo with the binutils, but newlib has its own repo. All forms I found are one of the following source text snippet

Re: Fix undefined shift overflow

2016-02-01 Thread Michael McConville
Nick Clifton wrote: > > Shifting into and out of the sign bit of an integer is undefined, > > and this loop unconditionally does both. The below patch should fix > > it. > > Patch approved and applied. Thanks for reporting this. Thanks! This idiom also appears in newlib and in various versions

Re: Fix undefined shift overflow

2016-02-01 Thread Nick Clifton
Hi Michael, Shifting into and out of the sign bit of an integer is undefined, and this loop unconditionally does both. The below patch should fix it. Patch approved and applied. Thanks for reporting this. Cheers Nick ___ bug-binutils mailing l

Fix undefined shift overflow

2016-01-28 Thread Michael McConville
Shifting into and out of the sign bit of an integer is undefined, and this loop unconditionally does both. The below patch should fix it. My analysis here applies: https://marc.info/?l=openbsd-tech&m=145377854103866&w=2 Thanks for your time, Michael diff --git a/opcodes/cgen-dis.c b/opcodes/cge