Potential problem with array mixin _get_effective_shape
I was just adding tests, when I had crash. Cause:
def _get_effective_shape(self):
...
for idx_expr in self.indices:
if isinstance(idx_expr, Range):
shape.append(_num_elements(idx_expr))
elif isinstance(idx_expr, Reference):
dtype = idx_expr.datatype
if dtype.shape:
This function is called from array_reference.datatype, with the content of map_adspc1_field_a(:,cell).
When working on the 2nd index, cell is a reference, but it's not an array and has no shape, so the test if dtype.shape just crashes.
I can work around this problem (by using array_reference.symbol.datatype instead of array_reference.datatype, and that's ok for me - but I am still wondering if this should be fixed in the code to avoid the crash?
Oops, that's a bit of an error :-( Yes, we should check that the Reference is an array before looking at its shape.
Fix is relatively straightforward - just use SIZE if we don't have an ArrayMixin. However, I've also found a bug in the validation of ArrayAssignment2LoopsTrans that I need to address.