From dbb3dd2dba903ad0f2bba1100ba628e21e1ff8f2 Mon Sep 17 00:00:00 2001
From: Florent Pruvost <florent.pruvost@inria.fr>
Date: Thu, 28 Sep 2023 08:56:28 +0200
Subject: [PATCH] Fix analysis issues.

---
 cmake_modules/morse_cmake                     |  2 +-
 compute/zgetrf.c                              |  5 ++---
 .../starpu/control/runtime_descriptor_ipiv.c  | 20 +++++++++----------
 3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/cmake_modules/morse_cmake b/cmake_modules/morse_cmake
index 022397487..a661fe7f4 160000
--- a/cmake_modules/morse_cmake
+++ b/cmake_modules/morse_cmake
@@ -1 +1 @@
-Subproject commit 022397487f40fb7688e5d0caef2e4708ca4b5fea
+Subproject commit a661fe7f446be00b203fef88b74957b1f3791ac0
diff --git a/compute/zgetrf.c b/compute/zgetrf.c
index 98d5f0e08..38ef81719 100644
--- a/compute/zgetrf.c
+++ b/compute/zgetrf.c
@@ -266,12 +266,11 @@ CHAMELEON_zgetrf( int M, int N, CHAMELEON_Complex64_t *A, int LDA, int *IPIV )
     chameleon_sequence_wait( chamctxt, sequence );
 
     /* Cleanup the temporary data */
-    CHAMELEON_zgetrf_WS_Free( ws );
-    chameleon_ztile2lap_cleanup( chamctxt, &descAl, &descAt );
-
     if ( ws->alg == ChamGetrfPPivPerColumn ) {
         chameleon_ipiv_destroy( &descIPIV );
     }
+    CHAMELEON_zgetrf_WS_Free( ws );
+    chameleon_ztile2lap_cleanup( chamctxt, &descAl, &descAt );
 
     status = sequence->status;
     chameleon_sequence_destroy( chamctxt, sequence );
diff --git a/runtime/starpu/control/runtime_descriptor_ipiv.c b/runtime/starpu/control/runtime_descriptor_ipiv.c
index efd5afb36..f7a651922 100644
--- a/runtime/starpu/control/runtime_descriptor_ipiv.c
+++ b/runtime/starpu/control/runtime_descriptor_ipiv.c
@@ -87,7 +87,7 @@ void *RUNTIME_ipiv_getaddr( const CHAM_ipiv_t *ipiv, int m )
     assert( handle );
 
     if ( *handle != NULL ) {
-        return *handle;
+        return (void*)(*handle);
     }
 
     const CHAM_desc_t *A = ipiv->desc;
@@ -104,7 +104,7 @@ void *RUNTIME_ipiv_getaddr( const CHAM_ipiv_t *ipiv, int m )
 #endif /* defined(CHAMELEON_USE_MPI) */
 
     assert( *handle );
-    return *handle;
+    return (void*)(*handle);
 }
 
 void *RUNTIME_nextpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h )
@@ -116,7 +116,7 @@ void *RUNTIME_nextpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h )
     assert( nextpiv );
 
     if ( *nextpiv != NULL ) {
-        return *nextpiv;
+        return (void*)(*nextpiv);
     }
 
     const CHAM_desc_t *A = ipiv->desc;
@@ -127,7 +127,7 @@ void *RUNTIME_nextpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h )
     cppi_register( nextpiv, A->dtyp, ncols, tag, owner );
 
     assert( *nextpiv );
-    return *nextpiv;
+    return (void*)(*nextpiv);
 }
 
 void *RUNTIME_prevpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h )
@@ -139,7 +139,7 @@ void *RUNTIME_prevpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h )
     assert( prevpiv );
 
     if ( *prevpiv != NULL ) {
-        return *prevpiv;
+        return (void*)(*prevpiv);
     }
 
     const CHAM_desc_t *A = ipiv->desc;
@@ -150,7 +150,7 @@ void *RUNTIME_prevpiv_getaddr( const CHAM_ipiv_t *ipiv, int m, int h )
     cppi_register( prevpiv, A->dtyp, ncols, tag, owner );
 
     assert( *prevpiv );
-    return *prevpiv;
+    return (void*)(*prevpiv);
 }
 
 void *RUNTIME_perm_getaddr( const CHAM_ipiv_t *ipiv, int m )
@@ -162,7 +162,7 @@ void *RUNTIME_perm_getaddr( const CHAM_ipiv_t *ipiv, int m )
     assert( handle );
 
     if ( *handle != NULL ) {
-        return *handle;
+        return (void*)(*handle);
     }
 
     const CHAM_desc_t *A = ipiv->desc;
@@ -179,7 +179,7 @@ void *RUNTIME_perm_getaddr( const CHAM_ipiv_t *ipiv, int m )
 #endif /* defined(CHAMELEON_USE_MPI) */
 
     assert( *handle );
-    return *handle;
+    return (void*)(*handle);
 }
 
 void *RUNTIME_invp_getaddr( const CHAM_ipiv_t *ipiv, int m )
@@ -191,7 +191,7 @@ void *RUNTIME_invp_getaddr( const CHAM_ipiv_t *ipiv, int m )
     assert( handle );
 
     if ( *handle != NULL ) {
-        return *handle;
+        return (void*)(*handle);
     }
 
     const CHAM_desc_t *A = ipiv->desc;
@@ -208,7 +208,7 @@ void *RUNTIME_invp_getaddr( const CHAM_ipiv_t *ipiv, int m )
 #endif /* defined(CHAMELEON_USE_MPI) */
 
     assert( *handle );
-    return *handle;
+    return (void*)(*handle);
 }
 
 void RUNTIME_ipiv_flushk( const RUNTIME_sequence_t *sequence,
-- 
GitLab