mirror of
https://github.com/intel/llvm.git
synced 2026-01-24 08:30:34 +08:00
[libunwind] Unbreak debug builds after r321440.
llvm-svn: 321446
This commit is contained in:
@@ -17,7 +17,6 @@
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <limits.h>
|
||||
|
||||
#include "libunwind.h"
|
||||
#include "dwarf2.h"
|
||||
@@ -26,6 +25,10 @@
|
||||
|
||||
namespace libunwind {
|
||||
|
||||
// Avoid relying on C++ headers.
|
||||
template <class T>
|
||||
static constexpr T pint_max_value() { return ~0; }
|
||||
|
||||
/// CFI_Parser does basic parsing of a CFI (Call Frame Information) records.
|
||||
/// See DWARF Spec for details:
|
||||
/// http://refspecs.linuxbase.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html
|
||||
@@ -540,7 +543,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
|
||||
results->cfaRegister = 0;
|
||||
results->cfaExpression = (int64_t)p;
|
||||
length = addressSpace.getULEB128(p, instructionsEnd);
|
||||
assert(length < std::numeric_limits<pint_t>::max() && "pointer overflow");
|
||||
assert(length < pint_max_value<pint_t>() && "pointer overflow");
|
||||
p += static_cast<pint_t>(length);
|
||||
_LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_expression(expression=0x%" PRIx64
|
||||
", length=%" PRIu64 ")\n",
|
||||
@@ -556,7 +559,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
|
||||
results->savedRegisters[reg].location = kRegisterAtExpression;
|
||||
results->savedRegisters[reg].value = (int64_t)p;
|
||||
length = addressSpace.getULEB128(p, instructionsEnd);
|
||||
assert(length < std::numeric_limits<pint_t>::max() && "pointer overflow");
|
||||
assert(length < pint_max_value<pint_t>() && "pointer overflow");
|
||||
p += static_cast<pint_t>(length);
|
||||
_LIBUNWIND_TRACE_DWARF("DW_CFA_expression(reg=%" PRIu64 ", "
|
||||
"expression=0x%" PRIx64 ", "
|
||||
@@ -642,7 +645,7 @@ bool CFI_Parser<A>::parseInstructions(A &addressSpace, pint_t instructions,
|
||||
results->savedRegisters[reg].location = kRegisterIsExpression;
|
||||
results->savedRegisters[reg].value = (int64_t)p;
|
||||
length = addressSpace.getULEB128(p, instructionsEnd);
|
||||
assert(length < std::numeric_limits<pint_t>::max() && "pointer overflow");
|
||||
assert(length < pint_max_value<pint_t>() && "pointer overflow");
|
||||
p += static_cast<pint_t>(length);
|
||||
_LIBUNWIND_TRACE_DWARF("DW_CFA_val_expression(reg=%" PRIu64 ", "
|
||||
"expression=0x%" PRIx64 ", length=%" PRIu64 ")\n",
|
||||
|
||||
Reference in New Issue
Block a user