This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rG7518e0ff63cd: Avoid using a variable-sized array for a tiny allocation. (authored by saugustine).
Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121732/new/ 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 {
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 {
_______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits