aboutsummaryrefslogtreecommitdiff
path: root/src/common/dwarf/dwarf2reader.cc
diff options
context:
space:
mode:
authorted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-06-25 16:56:48 +0000
committerted.mielczarek <ted.mielczarek@4c0a9323-5329-0410-9bdc-e9ce6186880e>2010-06-25 16:56:48 +0000
commit6869f2e1b3d658c7048347c2bc87fb231f567e25 (patch)
treeb2b33ff787355a790512a283b91cb60aac9e6cbc /src/common/dwarf/dwarf2reader.cc
parentBreakpad Mac symbol dumper: Unify with Linux dumper; support DWARF CFI. (diff)
downloadbreakpad-6869f2e1b3d658c7048347c2bc87fb231f567e25.tar.xz
Breakpad DWARF CFI parser: Use the proper type for offsets in CallFrameInfo::Rule subclasses.
The subclasses of CallFrameInfo::Rule store the rule currently in force for recovering a register or computing the canonical frame address. Their sole responsibility is to accurately convey rules from the parser, which creates them, to a CallFrameInfo::Handler member function, which consumes them. So, the types of their data members should match those of the corresponding arguments of the corresponding Handler member function. CallFrameInfo::OffsetRule and CallFrameInfo::ValOffsetRule use an 'int' to store the rule's offset value, but CallFrameInfo::Handler::OffsetRule and ...::ValOffsetRule expect a 'long'. On ABIs where 'long' is larger than 'int', this can cause values to be truncated or sign-extended unexpectedly. This patch changes those members to 'long'. Fortunately, offsets appearing in real DWARF call frame information never even come close to the limits of a 32-bit int, so this bug is unlikely to cause any practical problems. A=jimb R=thestig git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@615 4c0a9323-5329-0410-9bdc-e9ce6186880e
Diffstat (limited to 'src/common/dwarf/dwarf2reader.cc')
-rw-r--r--src/common/dwarf/dwarf2reader.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc
index b2b9d0de..1a397019 100644
--- a/src/common/dwarf/dwarf2reader.cc
+++ b/src/common/dwarf/dwarf2reader.cc
@@ -969,7 +969,7 @@ class CallFrameInfo::OffsetRule: public CallFrameInfo::Rule {
// computes the address at which a register is saved, not a value.
private:
int base_register_;
- int offset_;
+ long offset_;
};
// Rule: the value the register had in the caller is the value of
@@ -996,7 +996,7 @@ class CallFrameInfo::ValOffsetRule: public CallFrameInfo::Rule {
void SetOffset(long long offset) { offset_ = offset; }
private:
int base_register_;
- int offset_;
+ long offset_;
};
// Rule: the register has been saved in another register REGISTER_NUMBER_.