Index: src/common/dwarf/dwarf2reader.cc |
diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc |
index 003ed7b188b6457a2ac3f84c787c823004cd524e..dc0e2349b02a4a9f07d7d0cf297fa44400247739 100644 |
--- a/src/common/dwarf/dwarf2reader.cc |
+++ b/src/common/dwarf/dwarf2reader.cc |
@@ -266,7 +266,9 @@ void CompilationUnit::ReadHeader() { |
header_.abbrev_offset = reader_->ReadOffset(headerptr); |
headerptr += reader_->OffsetSize(); |
- assert(headerptr + 1 < buffer_ + buffer_length_); |
+ // Compare against less than or equal because this may be the last |
+ // section in the file. |
+ assert(headerptr + 1 <= buffer_ + buffer_length_); |
header_.address_size = reader_->ReadOneByte(headerptr); |
reader_->SetAddressSize(header_.address_size); |
headerptr += 1; |