zanmato1984 commented on code in PR #40484:
URL: https://github.com/apache/arrow/pull/40484#discussion_r1541520440


##########
cpp/src/arrow/compute/util.cc:
##########
@@ -58,6 +58,15 @@ void TempVectorStack::release(int id, uint32_t num_bytes) {
   --num_vectors_;
 }
 
+Status TempVectorStack::CheckAllocationOverflow(int64_t alloc_size) {
+  // Stack overflow check (see GH-39582).
+  if ((alloc_size + top_) > buffer_size_) {
+    return Status::Invalid("TempVectorStack alloc overflow. (Actual ", 
buffer_size_,
+                           "Bytes, expect ", alloc_size, "Bytes)");

Review Comment:
   ```suggestion
       return Status::Invalid("TempVectorStack allocation overflow: capacity ", 
buffer_size_, ", current size ", top, ", attempt allocating ", alloc_size);
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to