From 69b1485a22dc2b8a2cfe0bd10edcbaad0da0cf6e Mon Sep 17 00:00:00 2001 From: strangerke Date: Thu, 12 May 2011 01:13:57 +0200 Subject: GIT: Clean up: Suppress SVN tags, now useless --- engines/sci/engine/vm.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'engines/sci/engine/vm.cpp') diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index b441815014..25b13020ee 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -18,9 +18,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * - * $URL$ - * $Id$ - * */ #include "common/debug.h" -- cgit v1.2.3 From bd2bfe85c97189e72199e5d0554ec4bd192a80b2 Mon Sep 17 00:00:00 2001 From: md5 Date: Fri, 13 May 2011 16:12:52 +0300 Subject: SCI: Don't include several debug tables when REDUCE_MEMORY_USAGE is defined --- engines/sci/engine/vm.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'engines/sci/engine/vm.cpp') diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 25b13020ee..499574957e 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -114,7 +114,9 @@ static bool validate_variable(reg_t *r, reg_t *stack_base, int type, int max, in return true; } +#ifndef REDUCE_MEMORY_USAGE extern const char *opcodeNames[]; // from scriptdebug.cpp +#endif static reg_t read_var(EngineState *s, int type, int index) { if (validate_variable(s->variables[type], s->stack_base, type, s->variablesMax[type], index)) { -- cgit v1.2.3 From 48140a012d69d76de5ae80de7ca926e71c39cd03 Mon Sep 17 00:00:00 2001 From: md5 Date: Fri, 27 May 2011 03:06:06 +0300 Subject: SCI: Don't attempt to modify null/disposed objects. These cases occur usually because of script bugs. Fixes script bug #3303802 - "SCI: PQ1VGA - Crash at the jail" --- engines/sci/engine/vm.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'engines/sci/engine/vm.cpp') diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index 499574957e..af34e6d924 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -297,6 +297,13 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPt if (argc > 0x800) // More arguments than the stack could possibly accomodate for error("send_selector(): More than 0x800 arguments to function call"); + if (send_obj.isNull()) { + warning("Attempt to invoke a selector of a null/disposed object. Ignoring call"); + framesize -= (2 + argc); + argp += argc + 1; + continue; + } + SelectorType selectorType = lookupSelector(s->_segMan, send_obj, selector, &varp, &funcp); if (selectorType == kSelectorNone) error("Send to invalid selector 0x%x of object at %04x:%04x", 0xffff & selector, PRINT_REG(send_obj)); -- cgit v1.2.3 From ff62a6050aedca96e69cb284c5406833e59ca588 Mon Sep 17 00:00:00 2001 From: Lars Skovlund Date: Fri, 27 May 2011 13:15:57 +0200 Subject: Revert "SCI: Don't attempt to modify null/disposed objects." This fix for bug #3303802 is a potential cause of unreproducible bugs in all SCI games that taint savegames. This reverts commit 48140a012d69d76de5ae80de7ca926e71c39cd03. --- engines/sci/engine/vm.cpp | 7 ------- 1 file changed, 7 deletions(-) (limited to 'engines/sci/engine/vm.cpp') diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp index af34e6d924..499574957e 100644 --- a/engines/sci/engine/vm.cpp +++ b/engines/sci/engine/vm.cpp @@ -297,13 +297,6 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPt if (argc > 0x800) // More arguments than the stack could possibly accomodate for error("send_selector(): More than 0x800 arguments to function call"); - if (send_obj.isNull()) { - warning("Attempt to invoke a selector of a null/disposed object. Ignoring call"); - framesize -= (2 + argc); - argp += argc + 1; - continue; - } - SelectorType selectorType = lookupSelector(s->_segMan, send_obj, selector, &varp, &funcp); if (selectorType == kSelectorNone) error("Send to invalid selector 0x%x of object at %04x:%04x", 0xffff & selector, PRINT_REG(send_obj)); -- cgit v1.2.3