https://sourceware.org/bugzilla/show_bug.cgi?id=18882

            Bug ID: 18882
           Summary: readelf computes undefined expression (long int) 1 <<
                    63
           Product: binutils
           Version: 2.25
            Status: NEW
          Severity: minor
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: zeccav at gmail dot com
  Target Milestone: ---

Running the gas testsuite with a gnu gcc sanitized version of readelf
I got the following sanitizer message

readelf.c:1569:37: runtime error: left shift of 1 by 63 places cannot be
represented in type 'long int'

the offending statement in readelf.c:1569 is

if (off == ((bfd_signed_vma) 1) << ((sizeof (bfd_signed_vma) * 8) - 1))

that tries to compute (long int) 1 << 63

but this is undefined.

Maybe it should be (unsigned long int) 1 << 63

-- 
You are receiving this mail because:
You are on the CC list for the bug.

_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to