rec-cpp: crash when running rom

This commit is contained in:
Flyinghead 2019-05-21 18:18:47 +02:00
parent 6055c13e77
commit 582c9f358c
1 changed files with 8 additions and 2 deletions

View File

@ -811,13 +811,19 @@ struct opcode_check_block : public opcodeExec {
opcodeExec* setup(RuntimeBlockInfo* block) {
this->block = block;
ptr = GetMemPtr(block->addr, 4);
code.resize(sz == -1 ? block->sh4_code_size : sz);
memcpy(&code[0], ptr, sz == -1 ? block->sh4_code_size : sz);
if (ptr != NULL)
{
code.resize(sz == -1 ? block->sh4_code_size : sz);
memcpy(&code[0], ptr, sz == -1 ? block->sh4_code_size : sz);
}
return this;
}
void execute() {
if (code.empty())
return;
switch (sz)
{
case 4: