示例#1
0
Node_ptr JumpNode::CreateFrom(Instruction_ptr i,/*{{{*/
		Instruction_list::iterator begin,
		Instruction_list::iterator end)
{
	Jump* jump = static_cast<Jump*>(i.get());
	Expression_ptr destination = jump->Operand();
	Addr address;

	if (destination->IsType(Expression::GLOBAL))
	{
		address = static_cast<GlobalVariable*>(destination.get())->Address();
	}
	else
	{
		message("%p Error! Jump destination is not a GlobalVariable!\n", jump->Address());
		address = INVALID_ADDR;
	}

	Node_ptr result ( new JumpNode(address, begin, end) );
	return result;
}/*}}}*/