diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/scriptdebug.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp index f5c1f8de8f..2bb58d4ff2 100644 --- a/engines/sci/engine/scriptdebug.cpp +++ b/engines/sci/engine/scriptdebug.cpp @@ -218,7 +218,11 @@ reg_t disassemble(EngineState *s, reg_t pos, const Object *obj, bool printBWTag, if (obj != nullptr) { const Object *const super = obj->getClass(s->_segMan); assert(super); - selectorName = kernel->getSelectorName(super->getVarSelector(param_value / 2)).c_str(); + if (param_value / 2 < super->getVarCount()) { + selectorName = kernel->getSelectorName(super->getVarSelector(param_value / 2)).c_str(); + } else { + selectorName = "<invalid>"; + } } else { selectorName = "<unavailable>"; } |