Skip to content

Commit

Permalink
Fix jump table analysis for 32-bit PIC code
Browse files Browse the repository at this point in the history
  • Loading branch information
mxz297 committed Jun 15, 2016
1 parent 7ce040d commit 93707dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions parseAPI/src/IndirectASTVisitor.C
Original file line number Diff line number Diff line change
Expand Up @@ -405,11 +405,11 @@ AST::Ptr JumpTableFormatVisitor::visit(DataflowAPI::RoseAST *ast) {
findIncorrectFormat = true;
} else if (roseAST->val().op == ROSEOperation::addOp) {
Address tableBase = 0;
if (roseAST->child(0)->getID() == AST::V_ConstantAST) {
if (roseAST->child(0)->getID() == AST::V_ConstantAST && roseAST->child(1)->getID() == AST::V_VariableAST) {
ConstantAST::Ptr constAST = boost::static_pointer_cast<ConstantAST>(roseAST->child(0));
tableBase = constAST->val().val;
}
if (roseAST->child(1)->getID() == AST::V_ConstantAST) {
if (roseAST->child(1)->getID() == AST::V_ConstantAST && roseAST->child(0)->getID() == AST::V_VariableAST) {
ConstantAST::Ptr constAST = boost::static_pointer_cast<ConstantAST>(roseAST->child(1));
tableBase = constAST->val().val;
}
Expand Down

0 comments on commit 93707dd

Please sign in to comment.