From f551e16213c52169af8bda554e4051b756a169cc Mon Sep 17 00:00:00 2001 From: Stephen Roberts <43952910+stephen-roberts-work@users.noreply.github.com> Date: Fri, 12 Oct 2018 17:50:24 +0100 Subject: dwarf: Add missing opcodes to the operands table in Gexpr.c This patch adds two opcodes to the operands table in Gexpr.c, which is a mapping between opcodes and the number and types of the operands for those opcodes. Two opcodes, DW_OP_constu and DW_OP_consts are missing from this table, which caused failures later in the CFI expression parsing logic. This patch adds the missing information into the table, and thus allows correct parsing of CFA_def_cfa_expression, CFA_expression and CFA_val_expression expressions which contain the offending opcodes. --- src/dwarf/Gexpr.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/dwarf/Gexpr.c b/src/dwarf/Gexpr.c index f63c3d22..709c0c8f 100644 --- a/src/dwarf/Gexpr.c +++ b/src/dwarf/Gexpr.c @@ -60,6 +60,8 @@ static const uint8_t operands[256] = [DW_OP_const4s] = OPND1 (VAL32), [DW_OP_const8u] = OPND1 (VAL64), [DW_OP_const8s] = OPND1 (VAL64), + [DW_OP_constu] = OPND1 (ULEB128), + [DW_OP_consts] = OPND1 (SLEB128), [DW_OP_pick] = OPND1 (VAL8), [DW_OP_plus_uconst] = OPND1 (ULEB128), [DW_OP_skip] = OPND1 (VAL16), -- cgit v1.2.1