diff options
| -rw-r--r-- | libunwind/src/DwarfParser.hpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libunwind/src/DwarfParser.hpp b/libunwind/src/DwarfParser.hpp index 645ac217a3d..b749b7776e1 100644 --- a/libunwind/src/DwarfParser.hpp +++ b/libunwind/src/DwarfParser.hpp @@ -25,10 +25,6 @@ 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 @@ -543,7 +539,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 < pint_max_value<pint_t>() && "pointer overflow"); + assert(length < static_cast<pint_t>(~0) && "pointer overflow"); p += static_cast<pint_t>(length); _LIBUNWIND_TRACE_DWARF("DW_CFA_def_cfa_expression(expression=0x%" PRIx64 ", length=%" PRIu64 ")\n", @@ -559,7 +555,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 < pint_max_value<pint_t>() && "pointer overflow"); + assert(length < static_cast<pint_t>(~0) && "pointer overflow"); p += static_cast<pint_t>(length); _LIBUNWIND_TRACE_DWARF("DW_CFA_expression(reg=%" PRIu64 ", " "expression=0x%" PRIx64 ", " @@ -645,7 +641,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 < pint_max_value<pint_t>() && "pointer overflow"); + assert(length < static_cast<pint_t>(~0) && "pointer overflow"); p += static_cast<pint_t>(length); _LIBUNWIND_TRACE_DWARF("DW_CFA_val_expression(reg=%" PRIu64 ", " "expression=0x%" PRIx64 ", length=%" PRIu64 ")\n", |

