Skip to content

Commit

Permalink
SCI: Let getClassAddress fail gracefully with SCRIPT_GET_DONT_LOAD
Browse files Browse the repository at this point in the history
This fixes a crash in the debugger when disassembling the class opcode
with a class from a script that hasn't yet been loaded.
  • Loading branch information
wjp committed May 16, 2017
1 parent cadd89e commit 779b833
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions engines/sci/engine/seg_manager.cpp
Expand Up @@ -1016,6 +1016,9 @@ reg_t SegManager::getClassAddress(int classnr, ScriptLoadType lock, uint16 calle
getScriptSegment(the_class->script, lock);

if (!the_class->reg.getSegment()) {
if (lock == SCRIPT_GET_DONT_LOAD)
return NULL_REG;

error("[VM] Trying to instantiate class %x by instantiating script 0x%x (%03d) failed", classnr, the_class->script, the_class->script);
}
} else
Expand Down

0 comments on commit 779b833

Please sign in to comment.