[Rose-public] Bug report for replacing expression in Fortran loop

Jichi Guo jichifly at gmail.com
Mon May 5 16:35:15 PDT 2014


I found a bug in SageInterface::replaceExpression. When use it to replace expressions in Fortran do loop, ROSE will crash with the following message:

        SageInterface::replaceExpression(). Unhandled parent expression type of SageIII enum value: SgFortranDo

I checked the replaceExpression function defined in sageInterface.C, and it seemed that SgFortranDo is not handled there.
The related code segments in sageInterface.C is as follow. Adding a case similar to SgForStatement could fix this problem.

void SageInterface::replaceExpression(SgExpression* oldExp, SgExpression* newExp, bool keepOldExp/*=false*/)
  else if (isSgForStatement(parent)) {
    ROSE_ASSERT (isSgForStatement(parent)->get_increment() == oldExp);
    // TODO: any other cases here??

Best regards,

More information about the rose-public mailing list