[Scummvm-cvs-logs] SF.net SVN: scummvm:[49231] scummvm/trunk/engines/sci/engine/vm.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed May 26 11:59:41 CEST 2010


Revision: 49231
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49231&view=rev
Author:   thebluegr
Date:     2010-05-26 09:59:40 +0000 (Wed, 26 May 2010)

Log Message:
-----------
After running some tests, it appears that modifying argc inside send_selector() was a bad idea. Reverting the relevant code, and putting the warning back, with some extra comments

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/vm.cpp

Modified: scummvm/trunk/engines/sci/engine/vm.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.cpp	2010-05-26 09:33:33 UTC (rev 49230)
+++ scummvm/trunk/engines/sci/engine/vm.cpp	2010-05-26 09:59:40 UTC (rev 49231)
@@ -397,10 +397,6 @@
 				printf("Varselector: Read\n");
 #endif // VM_DEBUG_SEND
 
-			// Make sure that argc is either 0 (read) or 1 (write) here.
-			// This isn't strictly necessary, but better safe than sorry
-			argc = MIN<int>(argc, 1);
-
 			// argc == 0: read selector
 			// argc != 0: write selector
 			if (printSendActions && !argc) {	// read selector
@@ -415,6 +411,13 @@
 				printSendActions = false;
 			}
 
+			if (argc > 1)
+				// argc can indeed be bigger than 1 in some cases, and it seems correct
+				// (i.e. we should skip that many bytes later on)... question is, why
+				// does this occur? Could such calls be used to point to data after X bytes in the heap?
+				// What are the skipped bytes in this case?
+				warning("send_selector(): more than 1 parameter (%d) while modifying a variable selector", argc);
+
 			{
 				CallsStruct call;
 				call.address.var = varp; // register the call


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