From c6485cb937cd9562a4a4f56e8282a4b9ab65b59e Mon Sep 17 00:00:00 2001 From: jimblandy Date: Tue, 3 Apr 2012 23:12:34 +0000 Subject: [PATCH] Accept version 3 .eh_frame unwinding data, as well as version 1. a=michaelrmmiller r=jimblandy git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@947 4c0a9323-5329-0410-9bdc-e9ce6186880e --- src/common/dwarf/dwarf2reader.cc | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index b4e61133..43566467 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -1857,20 +1857,14 @@ bool CallFrameInfo::ReadCIEFields(CIE *cie) { cie->version = reader_->ReadOneByte(cursor); cursor++; - // If we don't recognize the version, we can't parse any more fields - // of the CIE. For DWARF CFI, we handle versions 1 through 3 (there - // was never a version 2 of CFI data). For .eh_frame, we handle only - // version 1. - if (eh_frame_) { - if (cie->version != 1) { - reporter_->UnrecognizedVersion(cie->offset, cie->version); - return false; - } - } else { - if (cie->version < 1 || cie->version > 3) { - reporter_->UnrecognizedVersion(cie->offset, cie->version); - return false; - } + // If we don't recognize the version, we can't parse any more fields of the + // CIE. For DWARF CFI, we handle versions 1 through 3 (there was never a + // version 2 of CFI data). For .eh_frame, we handle versions 1 and 3 as well; + // the difference between those versions seems to be the same as for + // .debug_frame. + if (cie->version < 1 || cie->version > 3) { + reporter_->UnrecognizedVersion(cie->offset, cie->version); + return false; } const char *augmentation_start = cursor;