summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Roberts <43952910+stephen-roberts-work@users.noreply.github.com>2018-10-12 17:50:24 +0100
committerDave Watson <davejwatson@fb.com>2018-10-12 09:50:24 -0700
commitf551e16213c52169af8bda554e4051b756a169cc (patch)
tree33f52649dd352e100f22d8892ff1a0bd578441c6
parent85d5bd3c861c44d7b3bba3a9fd2ae18f99c3f820 (diff)
downloadlibunwind-f551e16213c52169af8bda554e4051b756a169cc.tar.gz
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.
-rw-r--r--src/dwarf/Gexpr.c2
1 files changed, 2 insertions, 0 deletions
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),