forked from OSchip/llvm-project
[libunwind] Fix evaluating DWARF operation DW_OP_pick
reg is unsigned type and used here for getting array element from the end by negating it. negation of unsigned can result in large number and array access with that index will result in segmentation fault. Fixes: https://bugs.llvm.org/show_bug.cgi?id=43872 Patched by: kamlesh kumar Differential Revision: https://reviews.llvm.org/D69893
This commit is contained in:
parent
3f96686700
commit
9366397f05
|
@ -433,7 +433,7 @@ DwarfInstructions<A, R>::evaluateExpression(pint_t expression, A &addressSpace,
|
|||
// pick from
|
||||
reg = addressSpace.get8(p);
|
||||
p += 1;
|
||||
value = sp[-reg];
|
||||
value = sp[-(int)reg];
|
||||
*(++sp) = value;
|
||||
if (log)
|
||||
fprintf(stderr, "duplicate %d in stack\n", reg);
|
||||
|
|
Loading…
Reference in New Issue