diff --git a/src/Transformations/ReplaceArraysInIO/replace_dist_arrays_in_io.cpp b/src/Transformations/ReplaceArraysInIO/replace_dist_arrays_in_io.cpp index e9c088d..f73e7c1 100644 --- a/src/Transformations/ReplaceArraysInIO/replace_dist_arrays_in_io.cpp +++ b/src/Transformations/ReplaceArraysInIO/replace_dist_arrays_in_io.cpp @@ -136,7 +136,8 @@ static void replaceArrayRec(SgSymbol* arr, SgSymbol* replace_by, SgExpression* e if (!exp) return; - if (exp->symbol() && exp->symbol()->identifier() && strcmp(exp->symbol()->identifier(), arr->identifier()) == 0) + if (isArrayRef(exp) && + strcmp(exp->symbol()->identifier(), arr->identifier()) == 0) { has_read |= from_read; has_write |= from_write;