コード例 #1
0
bool
RoseBin_DataFlowAnalysis::existsPath(SgGraphNode* start, SgGraphNode* end) {
  // make sure its not a SgAsmCall and the next node is a DirectedControlFlowEdge
  ROSE_ASSERT(g_algo->info);
  bool exists = false;
  ROSE_ASSERT(start);
  ROSE_ASSERT(end);
  SgAsmX86Instruction* next = isSgAsmX86Instruction(start);
  SgAsmX86Instruction* endAsm = isSgAsmX86Instruction(end);
  if (next && endAsm) {
    while (next!=endAsm) {
      next = isSgAsmX86Instruction(next->cfgBinFlowOutEdge(g_algo->info));
      if (next==NULL)
        break;
      if ((next->get_kind() == x86_call || next->get_kind() == x86_ret) && next!=endAsm)
        break;
    }
    exists = true;
  }
  return exists;
}