[Scummvm-cvs-logs] SF.net SVN: scummvm:[53048] scummvm/branches/branch-1-2-0/engines/sci/ engine/vm.cpp

wjpalenstijn at users.sourceforge.net wjpalenstijn at users.sourceforge.net
Thu Oct 7 16:58:35 CEST 2010


Revision: 53048
          http://scummvm.svn.sourceforge.net/scummvm/?rev=53048&view=rev
Author:   wjpalenstijn
Date:     2010-10-07 14:58:35 +0000 (Thu, 07 Oct 2010)

Log Message:
-----------
SCI: Backport r53046/53047: unknown valgrind cases->fake 0 when official

we will fake 0 instead of error()ing out in official releases, when an uninitialized temp is read

Modified Paths:
--------------
    scummvm/branches/branch-1-2-0/engines/sci/engine/vm.cpp

Modified: scummvm/branches/branch-1-2-0/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sci/engine/vm.cpp	2010-10-07 14:57:59 UTC (rev 53047)
+++ scummvm/branches/branch-1-2-0/engines/sci/engine/vm.cpp	2010-10-07 14:58:35 UTC (rev 53048)
@@ -207,10 +207,21 @@
 				//  We need to find correct replacements for each situation manually
 				SciTrackOriginReply originReply;
 				SciWorkaroundSolution solution = trackOriginAndFindWorkaround(index, uninitializedReadWorkarounds, &originReply);
-				if (solution.type == WORKAROUND_NONE)
+				if (solution.type == WORKAROUND_NONE) {
+#ifdef RELEASE_BUILD
+					// If we are running an official ScummVM release -> fake 0 in unknown cases
+					warning("Uninitialized read for temp %d from method %s::%s (script %d, room %d, localCall %x)", 
+					index, originReply.objectName.c_str(), originReply.methodName.c_str(), originReply.scriptNr, 
+					g_sci->getEngineState()->currentRoomNumber(), originReply.localCallOffset);
+
+					r[index] = NULL_REG;
+					break;
+#else
 					error("Uninitialized read for temp %d from method %s::%s (script %d, room %d, localCall %x)", 
 					index, originReply.objectName.c_str(), originReply.methodName.c_str(), originReply.scriptNr, 
 					g_sci->getEngineState()->currentRoomNumber(), originReply.localCallOffset);
+#endif
+				}
 				assert(solution.type == WORKAROUND_FAKE);
 				r[index] = make_reg(0, solution.value);
 				break;


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