Avoid using a variable-sized array for a tiny allocation.

Differential Revision: https://reviews.llvm.org/D121732
This commit is contained in:
Sterling Augustine 2022-03-15 12:48:31 -07:00
parent 8e776bb660
commit 7518e0ff63
1 changed files with 2 additions and 2 deletions

View File

@ -1297,7 +1297,7 @@ bool DWARFExpression::Evaluate(
addr_t load_addr = *maybe_load_addr;
if (load_addr == LLDB_INVALID_ADDRESS && so_addr.IsSectionOffset()) {
uint8_t addr_bytes[size];
uint8_t addr_bytes[8];
Status error;
if (exe_ctx->GetTargetRef().ReadMemory(
@ -1306,7 +1306,7 @@ bool DWARFExpression::Evaluate(
ObjectFile *objfile = module_sp->GetObjectFile();
stack.back().GetScalar() = DerefSizeExtractDataHelper(
addr_bytes, sizeof(addr_bytes), objfile->GetByteOrder(), size);
addr_bytes, size, objfile->GetByteOrder(), size);
stack.back().ClearContext();
break;
} else {