aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2017-05-16 22:41:47 +0200
committerWillem Jan Palenstijn2017-05-16 22:41:47 +0200
commit779b8336b1227f010099f8faabe4d0c9b035832e (patch)
treeceddc138e8f3daed7afe8f9aa8b649eb44239083 /engines/sci
parentcadd89e675dbca906fb492fac4e4738bf646bf9e (diff)
downloadscummvm-rg350-779b8336b1227f010099f8faabe4d0c9b035832e.tar.gz
scummvm-rg350-779b8336b1227f010099f8faabe4d0c9b035832e.tar.bz2
scummvm-rg350-779b8336b1227f010099f8faabe4d0c9b035832e.zip
SCI: Let getClassAddress fail gracefully with SCRIPT_GET_DONT_LOAD
This fixes a crash in the debugger when disassembling the class opcode with a class from a script that hasn't yet been loaded.
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/engine/seg_manager.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index d13d94a957..a941dd38b4 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -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