[Lldb-commits] [PATCH] D142309: [LLDB][NFC] Fix a incorrect use of shared_ptr in RenderScriptRuntime.cpp

Shivam Gupta via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 23 21:14:14 PST 2023


xgupta updated this revision to Diff 491597.
xgupta added a comment.

address comments


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142309

Files:
  lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp


Index: lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
===================================================================
--- lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
+++ lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
@@ -2368,7 +2368,7 @@
 
   // Allocate a buffer to copy data into
   const uint32_t size = *alloc->size.get();
-  std::shared_ptr<uint8_t> buffer(new uint8_t[size]);
+  std::shared_ptr<uint8_t []> buffer(new uint8_t[size]);
   if (!buffer) {
     LLDB_LOGF(log, "%s - couldn't allocate a %" PRIu32 " byte buffer",
               __FUNCTION__, size);
@@ -2695,7 +2695,7 @@
   }
 
   // Create the headers describing the element type of the allocation.
-  std::shared_ptr<uint8_t> element_header_buffer(
+  std::shared_ptr<uint8_t []> element_header_buffer(
       new uint8_t[element_header_size]);
   if (element_header_buffer == nullptr) {
     strm.Printf("Internal Error: Couldn't allocate %" PRIu64


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142309.491597.patch
Type: text/x-patch
Size: 1065 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20230124/26fed5c3/attachment.bin>


More information about the lldb-commits mailing list