fix regression in shares_memory for zero size arrays
@@ -28,7 +28,7 @@ def _get_memory_ptrs(x):
def shares_memory(a, b, max_work=None):
- if a is b:
+ if a is b and a.size != 0:
return True
if max_work == 'MAY_SHARE_BOUNDS':
return _memory_range.may_share_bounds(a, b)
