Copilot commented on code in PR #9270:
URL: https://github.com/apache/incubator-gluten/pull/9270#discussion_r2038735086


##########
cpp-ch/local-engine/local_engine_jni.cpp:
##########
@@ -536,12 +541,24 @@ 
Java_org_apache_gluten_vectorized_CHNativeBlock_nativeBlockStats(JNIEnv * env, j
     LOCAL_ENGINE_JNI_METHOD_END(env, nullptr)
 }
 
+JNIEXPORT jlong
+Java_org_apache_gluten_vectorized_CHNativeBlock_copyBlock(JNIEnv * env, 
jobject obj, jlong block_address)
+{
+    LOCAL_ENGINE_JNI_METHOD_START
+    DB::Block * block = reinterpret_cast<DB::Block *>(block_address);
+
+    auto copied_block = block->cloneWithColumns(block->getColumns());
+    auto a = new DB::Block(copied_block);
+    return reinterpret_cast<jlong>(a);
+    LOCAL_ENGINE_JNI_METHOD_END(env, -1)

Review Comment:
   The call to LOCAL_ENGINE_JNI_METHOD_END appears after a return statement in 
Java_org_apache_gluten_vectorized_CHNativeBlock_copyBlock, making it 
unreachable. Consider moving the macro invocation before the return or 
restructuring the function to ensure proper cleanup.
   ```suggestion
       LOCAL_ENGINE_JNI_METHOD_END(env, -1)
       return reinterpret_cast<jlong>(a);
   ```



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