Commit 0f474404 authored by Thomas Jahns's avatar Thomas Jahns 🤸
Browse files

Prevent passing of zero-size arrays to C_LOC.

parent 6ba3e7b1
......@@ -144,8 +144,16 @@ CONTAINS
TYPE(xt_xmap) :: xmap
TYPE(c_ptr) :: src_com_p, dst_com_p
src_com_p = C_LOC(src_com)
dst_com_p = C_LOC(dst_com)
IF (num_src_intersections > 0) THEN
src_com_p = C_LOC(src_com)
ELSE
src_com_p = c_null_ptr
END IF
IF (num_dst_intersections > 0) THEN
dst_com_p = C_LOC(dst_com)
ELSE
dst_com_p = c_null_ptr
END IF
xmap = xt_xmap_c2f(xmi_new_f2c(&
num_src_intersections, src_com_p, &
num_dst_intersections, dst_com_p, &
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment