[Lldb-commits] [PATCH] D121732: Avoid using a variable-sized array for a tiny allocation.
Sterling Augustine via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Mar 15 12:57:41 PDT 2022
saugustine created this revision.
Herald added a project: All.
saugustine requested review of this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D121732
Files:
lldb/source/Expression/DWARFExpression.cpp
Index: lldb/source/Expression/DWARFExpression.cpp
===================================================================
--- lldb/source/Expression/DWARFExpression.cpp
+++ lldb/source/Expression/DWARFExpression.cpp
@@ -1297,7 +1297,7 @@
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 @@
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 {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121732.415550.patch
Type: text/x-patch
Size: 895 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20220315/f16fb223/attachment-0001.bin>
More information about the lldb-commits
mailing list