Copilot commented on code in PR #12405:
URL: https://github.com/apache/gluten/pull/12405#discussion_r3571693754


##########
cpp/velox/compute/WholeStageResultIterator.h:
##########
@@ -131,6 +133,7 @@ class WholeStageResultIterator : public 
SplitAwareColumnarBatchIterator {
 
   /// Memory.
   VeloxMemoryManager* memoryManager_;
+  VeloxRuntime* veloxRuntime_;
 

Review Comment:
   `veloxRuntime_` is only used in the constructor to call 
`registerConnectors()` (no other usages in the class). Keeping it as a stored 
raw pointer increases coupling and introduces avoidable lifetime/UAF risk. 
Consider removing the member and just using the constructor parameter (or 
register connectors before constructing the iterator).



##########
cpp/velox/compute/WholeStageResultIterator.cc:
##########
@@ -120,8 +120,10 @@ WholeStageResultIterator::WholeStageResultIterator(
     VeloxConnectorIds connectorIds,
     const std::string spillDir,
     const std::shared_ptr<facebook::velox::config::ConfigBase>& veloxCfg,
-    const SparkTaskInfo& taskInfo)
+    const SparkTaskInfo& taskInfo,
+    VeloxRuntime* veloxRuntime)
     : memoryManager_(memoryManager),
+      veloxRuntime_(veloxRuntime),
       veloxCfg_(veloxCfg),

Review Comment:
   `veloxRuntime_` is only used here to call `registerConnectors()`. Storing it 
as a member doesn’t appear necessary and can create lifetime hazards; prefer 
checking/using the `veloxRuntime` parameter directly (and drop the member) if 
the pointer isn’t needed after construction.



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to