Skip to content

Commit

Permalink
Fix checking of zero flag for table index
Browse files Browse the repository at this point in the history
  • Loading branch information
mxz297 committed Nov 11, 2016
1 parent 0058983 commit 810d689
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions parseAPI/src/IndirectASTVisitor.C
Expand Up @@ -372,10 +372,17 @@ AST::Ptr ComparisonVisitor::visit(DataflowAPI::RoseAST *ast) {
else
parsing_printf("WARNING: constant bit size %d exceeds 64!\n", size);
minuend = ConstantAST::create(Constant(val, size));
} else {
// Otherwise, the minuend ast is in the form of add(invert(minuend), 1)
// Need to extract the real minuend
minuend = minuend->child(0)->child(0);
} else if (minuend->getID() == AST::V_RoseAST) {
RoseAST::Ptr sub = boost::static_pointer_cast<RoseAST>(minuend);
minuend = AST::Ptr();
if (sub->val().op == ROSEOperation::addOp && sub->child(0)->getID() == AST::V_RoseAST) {
sub = boost::static_pointer_cast<RoseAST>(sub->child(0));
if (sub->val().op == ROSEOperation::invertOp) {
// Otherwise, the minuend ast is in the form of add(invert(minuend), 1)
// Need to extract the real minuend
minuend = sub->child(0);
}
}
}
}
}
Expand Down

0 comments on commit 810d689

Please sign in to comment.