summaryrefslogtreecommitdiff
path: root/binutils/dwarf.c
diff options
context:
space:
mode:
authorCary Coutant <ccoutant@google.com>2013-05-15 16:36:38 +0000
committerCary Coutant <ccoutant@google.com>2013-05-15 16:36:38 +0000
commit594f19cd071cd167f1c7333bcbdaaee75654acdd (patch)
tree50a236093d0ddf994c3981d2f748652eb86a1910 /binutils/dwarf.c
parent93f74b2b7837d74a5e90c65a78740958e490d975 (diff)
downloadbinutils-redhat-594f19cd071cd167f1c7333bcbdaaee75654acdd.tar.gz
binutils/
* dwarf.c (SAFE_BYTE_GET64): Correct end-of-buffer check; don't increment PTR. (decode_location_expression): DW_OP_const2u should read 2 bytes. (display_debug_lines_decoded): Adjust formatting. * elfcomm.c (byte_get_little_endian): Add cases for 5-, 6-, and 7-byte reads. (byte_get_big_endian): Likewise. (byte_get_signed): Likewise.
Diffstat (limited to 'binutils/dwarf.c')
-rw-r--r--binutils/dwarf.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 774904c4d9..862a060bd9 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -337,13 +337,12 @@ read_uleb128 (unsigned char * data,
#define SAFE_BYTE_GET64(PTR, HIGH, LOW, END) \
do \
{ \
- if (((PTR) + 8) < (END)) \
+ if (((PTR) + 8) <= (END)) \
{ \
byte_get_64 ((PTR), (HIGH), (LOW)); \
} \
else \
{ \
- PTR = END; \
* (LOW) = * (HIGH) = 0; \
} \
} \
@@ -883,7 +882,7 @@ decode_location_expression (unsigned char * data,
printf ("DW_OP_const1s: %ld", (long) svalue);
break;
case DW_OP_const2u:
- SAFE_BYTE_GET_AND_INC (uvalue, data, 1, end);
+ SAFE_BYTE_GET_AND_INC (uvalue, data, 2, end);
printf ("DW_OP_const2u: %lu", (unsigned long) uvalue);
break;
case DW_OP_const2s:
@@ -3184,7 +3183,8 @@ display_debug_lines_decoded (struct dwarf_section *section,
break;
case DW_LNE_set_address:
SAFE_BYTE_GET_AND_INC (state_machine_regs.address,
- op_code_data, ext_op_code_len - bytes_read - 1,
+ op_code_data,
+ ext_op_code_len - bytes_read - 1,
end);
state_machine_regs.op_index = 0;
break;