[cpu] Use dynamic cast for downcasting pointers
This commit is contained in:
parent
0cf34743cc
commit
74d30f8348
|
@ -106,7 +106,7 @@ Symbol::Status Module::DeclareFunction(uint32_t address,
|
|||
Symbol* symbol;
|
||||
Symbol::Status status =
|
||||
DeclareSymbol(Symbol::Type::kFunction, address, &symbol);
|
||||
*out_function = static_cast<Function*>(symbol);
|
||||
*out_function = dynamic_cast<Function*>(symbol);
|
||||
return status;
|
||||
}
|
||||
|
||||
|
|
|
@ -197,7 +197,7 @@ Function* Processor::DefineBuiltin(const std::string& name,
|
|||
function->set_end_address(address + 4);
|
||||
function->set_name(name);
|
||||
|
||||
auto builtin_function = static_cast<BuiltinFunction*>(function);
|
||||
auto builtin_function = dynamic_cast<BuiltinFunction*>(function);
|
||||
builtin_function->SetupBuiltin(handler, arg0, arg1);
|
||||
|
||||
function->set_status(Symbol::Status::kDeclared);
|
||||
|
|
Loading…
Reference in New Issue