aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2016-09-26 10:32:09 -0500
committerColin Snover2016-09-29 19:39:16 -0500
commit5877542d7eca653ffaa31f2666bc32ffca241e61 (patch)
treecb95405e49dddf235f8b09a7d6657ba13e37edef
parent3f6cfff225f6b23310e25e3ff44423ef2e49ad8c (diff)
downloadscummvm-rg350-5877542d7eca653ffaa31f2666bc32ffca241e61.tar.gz
scummvm-rg350-5877542d7eca653ffaa31f2666bc32ffca241e61.tar.bz2
scummvm-rg350-5877542d7eca653ffaa31f2666bc32ffca241e61.zip
SCI32: Ease debugging of wrong array types
-rw-r--r--engines/sci/engine/segment.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/sci/engine/segment.h b/engines/sci/engine/segment.h
index fd9b3f759e..2af47801b2 100644
--- a/engines/sci/engine/segment.h
+++ b/engines/sci/engine/segment.h
@@ -664,7 +664,9 @@ public:
const reg_t *source = values;
int16 *target = (int16 *)_data + index;
while (count--) {
- assert(source->isNumber());
+ if (!source->isNumber()) {
+ error("Non-number %04x:%04x sent to int16 array", PRINT_REG(*source));
+ }
*target++ = source->toSint16();
++source;
}
@@ -683,7 +685,9 @@ public:
const reg_t *source = values;
byte *target = (byte *)_data + index;
while (count--) {
- assert(source->isNumber());
+ if (!source->isNumber()) {
+ error("Non-number %04x:%04x sent to byte or string array", PRINT_REG(*source));
+ }
*target++ = source->getOffset();
++source;
}