[Scummvm-git-logs] scummvm master -> 8420310989cd52627c95ee6966bbe46f99626239

sev- sev at scummvm.org
Sat Feb 11 09:51:35 CET 2017


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8420310989 DIRECTOR: Lingo: Implemented sanity checks for built-ins


Commit: 8420310989cd52627c95ee6966bbe46f99626239
    https://github.com/scummvm/scummvm/commit/8420310989cd52627c95ee6966bbe46f99626239
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2017-02-11T09:53:47+01:00

Commit Message:
DIRECTOR: Lingo: Implemented sanity checks for built-ins

Changed paths:
    engines/director/lingo/lingo-code.cpp


diff --git a/engines/director/lingo/lingo-code.cpp b/engines/director/lingo/lingo-code.cpp
index b79e51d..ee32cf0 100644
--- a/engines/director/lingo/lingo-code.cpp
+++ b/engines/director/lingo/lingo-code.cpp
@@ -1063,11 +1063,24 @@ void Lingo::call(Common::String name, int nargs) {
 	}
 
 	if (sym->type == BLTIN || sym->type == FBLTIN) {
-		if (sym->u.bltin == b_factory)
+		if (sym->u.bltin == b_factory) {
 			g_lingo->factoryCall(name, nargs);
-		else
+		} else {
+			int stackSize = _stack.size() - nargs;
+
 			(*sym->u.bltin)(nargs);
 
+			int stackNewSize = _stack.size();
+
+			if (sym->type == FBLTIN) {
+				if (stackNewSize - stackSize != 1)
+					warning("built-in function %s did not return value", name.c_str());
+			} else {
+				if (stackNewSize - stackSize != 0)
+					warning("built-in procedure %s returned extra %d values", name.c_str(), stackNewSize - stackSize);
+			}
+		}
+
 		return;
 	}
 





More information about the Scummvm-git-logs mailing list