Fix signed comparison warning in extended opcode parsing.
authorRoland McGrath <roland@redhat.com>
Tue, 22 Jun 2010 20:13:53 +0000 (13:13 -0700)
committerRoland McGrath <roland@redhat.com>
Tue, 22 Jun 2010 20:13:53 +0000 (13:13 -0700)
libdw/ChangeLog
libdw/dwarf_getsrclines.c

index c87634f..5d274cb 100644 (file)
@@ -1,3 +1,8 @@
+2010-06-22  Roland McGrath  <roland@redhat.com>
+
+       * dwarf_getsrclines.c: Fix signed comparison warning in extended
+       opcode parsing.
+
 2010-06-21  Roland McGrath  <roland@redhat.com>
 
        * dwarf.h: Add DW_TAG_GNU_* constants.
index afdf9db..6840b2b 100644 (file)
@@ -433,9 +433,9 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines)
                goto invalid_data;
 
              /* The length.  */
-             unsigned int len = *linep++;
+             uint_fast8_t len = *linep++;
 
-             if (unlikely (lineendp - linep < len))
+             if (unlikely ((size_t) (lineendp - linep) < len))
                goto invalid_data;
 
              /* The sub-opcode.  */
@@ -530,7 +530,7 @@ dwarf_getsrclines (Dwarf_Die *cudie, Dwarf_Lines **lines, size_t *nlines)
 
                default:
                  /* Unknown, ignore it.  */
-                 if (unlikely (lineendp - (linep - 1)) < len)
+                 if (unlikely ((size_t) (lineendp - (linep - 1)) < len))
                    goto invalid_data;
                  linep += len - 1;
                  break;