[Lldb-commits] [PATCH] D121408: Fixing DWARFExpression handling of ValueType::FileAddress case for DW_OP_deref_size

Sterling Augustine via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 15 12:45:06 PDT 2022


saugustine added a comment.
Herald added a subscriber: JDevlieghere.

This change uses a variable-sized array, which is c99 only:

  third_party/llvm/llvm-project/lldb/source/Expression/DWARFExpression.cpp:1300:30: error: variable length arrays are a C99 feature [-Werror,-Wvla-extension]
            uint8_t addr_bytes[size];
                               ^~~~
  third_party/llvm/llvm-project/lldb/source/Expression/DWARFExpression.cpp:1300:30: note: read of non-const variable 'size' is not allowed in a constant expression
  third_party/llvm/llvm-project/lldb/source/Expression/DWARFExpression.cpp:1242:15: note: declared here
        uint8_t size = opcodes.GetU8(&offset);

But I the size of the array is limited to only to the address size of the target machine, so converting that to a simple eight-byte array and then using size instead of sizeof(addr_bytes) should be fine. I have a change in testing to do that.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121408/new/

https://reviews.llvm.org/D121408



More information about the lldb-commits mailing list