]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix problems in last checkin.
authorUlrich Drepper <drepper@redhat.com>
Tue, 22 Jan 2008 06:08:30 +0000 (06:08 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 22 Jan 2008 06:08:30 +0000 (06:08 +0000)
libcpu/i386_disasm.c
libdw/dwarf_getpubnames.c

index 9024571c99c5b2c82ad7bf38f24b8c02497d69ad..843fd74988a82e4521807aa218f8820d532f0577 100644 (file)
@@ -589,22 +589,26 @@ i386_disasm (const uint8_t **startp, const uint8_t *end, GElf_Addr addr,
 #endif
 
                        case 0x98:
+#ifdef X86_64
                          if (prefixes == (has_rex_w | has_rex))
                            {
                              str = "cltq";
                              break;
                            }
+#endif
                          if (prefixes & ~has_data16)
                            goto print_prefix;
                          str = prefixes & has_data16 ? "cbtw" : "cwtl";
                          break;
 
                        case 0x99:
+#ifdef X86_64
                          if (prefixes == (has_rex_w | has_rex))
                            {
                              str = "cqto";
                              break;
                            }
+#endif
                          if (prefixes & ~has_data16)
                            goto print_prefix;
                          str = prefixes & has_data16 ? "cwtd" : "cltd";
index 08b96cdc0128e26f6c162cb791d818d7ca949d8e..fcf6eca4098ba292a48b805731be1721269805a6 100644 (file)
@@ -1,5 +1,5 @@
 /* Get public symbol information.
-   Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2008 Red Hat, Inc.
    This file is part of Red Hat elfutils.
    Written by Ulrich Drepper <drepper@redhat.com>, 2002.
 
@@ -129,10 +129,13 @@ get_offsets (Dwarf *dbg)
        mem[cnt].cu_offset = read_8ubyte_unaligned (dbg, readp + 2);
 
       /* Determine the size of the CU header.  */
-      assert (dbg->sectiondata[IDX_debug_info] != NULL);
-      assert (dbg->sectiondata[IDX_debug_info]->d_buf != NULL);
-      assert (mem[cnt].cu_offset + 3
-             < dbg->sectiondata[IDX_debug_info]->d_size);
+      if (dbg->sectiondata[IDX_debug_info] == NULL
+         || dbg->sectiondata[IDX_debug_info]->d_buf == NULL
+         || mem[cnt].cu_offset + 3 >= dbg->sectiondata[IDX_debug_info]->d_size)
+       {
+         __libdw_seterrno (DWARF_E_INVALID_DWARF);
+         goto err_return;
+       }
       unsigned char *infop
        = ((unsigned char *) dbg->sectiondata[IDX_debug_info]->d_buf
           + mem[cnt].cu_offset);