Closes #2533 (closed)
Objects that are implemented via the FFI are of type HID (and sometimes UNQ) from the perspective of the code generation. We cannot do anything with them except via external function calls. The distributed-memory backend handles these by only allowing one node (SAC_DISTMEM_RANK_SOURCE) to use these variables. The generated code looked like
if (SAC_DISTMEM_rank = SAC_DISTMEM_RANK_SOURCE) {
UNQ = external_func(...);
} else {
UNQ = NULL;
}
so that if another node tries to illegally use UNQ, it will segfault. However, with the addition of ctype, UNQ may have another type, so it now looks like
T UNQ = (T)0;
...
if (SAC_DISTMEM_rank = SAC_DISTMEM_RANK_SOURCE) {
UNQ = external_func(...);
} else {
UNQ = NULL;
}
and that makes the = NULL assignment illegal. It is also not necessary, as UNQ is already initialized upon declaration. So I have removed this code.