[Scummvm-cvs-logs] SF.net SVN: scummvm:[46949] scummvm/trunk/engines/sci/engine
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sun Jan 3 22:12:44 CET 2010
Revision: 46949
http://scummvm.svn.sourceforge.net/scummvm/?rev=46949&view=rev
Author: thebluegr
Date: 2010-01-03 21:12:44 +0000 (Sun, 03 Jan 2010)
Log Message:
-----------
Fixed compilation with DISABLE_VALIDATIONS, and fixed a bug in kPrevNode
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kernel.h
scummvm/trunk/engines/sci/engine/klists.cpp
scummvm/trunk/engines/sci/engine/vm.cpp
Modified: scummvm/trunk/engines/sci/engine/kernel.h
===================================================================
--- scummvm/trunk/engines/sci/engine/kernel.h 2010-01-03 21:09:26 UTC (rev 46948)
+++ scummvm/trunk/engines/sci/engine/kernel.h 2010-01-03 21:12:44 UTC (rev 46949)
@@ -41,6 +41,7 @@
struct List; // from segment.h
//#define DEBUG_PARSER // enable for parser debugging
+//#define DISABLE_VALIDATIONS // enable to stop validation checks
/* Generic description: */
typedef reg_t KernelFunc(EngineState *s, int argc, reg_t *argv);
Modified: scummvm/trunk/engines/sci/engine/klists.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/klists.cpp 2010-01-03 21:09:26 UTC (rev 46948)
+++ scummvm/trunk/engines/sci/engine/klists.cpp 2010-01-03 21:12:44 UTC (rev 46949)
@@ -247,8 +247,10 @@
reg_t kPrevNode(EngineState *s, int argc, reg_t *argv) {
Node *n = s->_segMan->lookupNode(argv[0]);
- if (!sane_nodep(s, argv[0]))
+ if (!sane_nodep(s, argv[0])) {
warning("List node at %04x:%04x is not sane anymore", PRINT_REG(argv[0]));
+ return NULL_REG;
+ }
return n->pred;
}
Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp 2010-01-03 21:09:26 UTC (rev 46948)
+++ scummvm/trunk/engines/sci/engine/vm.cpp 2010-01-03 21:12:44 UTC (rev 46949)
@@ -185,7 +185,7 @@
# define validate_arithmetic(r) ((r).offset)
# define signed_validate_arithmetic(r) ((int) ((r).offset) & 0x8000 ? (signed) ((r).offset) - 65536 : ((r).offset))
# define validate_variable(r, sb, t, m, i, l)
-# define validate_read_var(r, sb, t, m, i, l) ((r)[i])
+# define validate_read_var(r, sb, t, m, i, l, dv) ((r)[i])
# define validate_write_var(r, sb, t, m, i, l, v, sm, k) ((r)[i] = (v))
# define validate_property(o, p) ((o)->_variables[p])
@@ -492,7 +492,7 @@
return &(s->_executionStack.back());
}
-#ifdef DISABLE_VALIDATONS
+#ifdef DISABLE_VALIDATIONS
# define kernel_matches_signature(a, b, c, d) 1
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list