[Scummvm-git-logs] scummvm master -> 45c329df6c588d85f2c3bcaed07795674f05af84
djsrv
dservilla at gmail.com
Wed Aug 5 15:18:51 UTC 2020
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:
45c329df6c DIRECTOR: LINGO: Fix b_return with no return value
Commit: 45c329df6c588d85f2c3bcaed07795674f05af84
https://github.com/scummvm/scummvm/commit/45c329df6c588d85f2c3bcaed07795674f05af84
Author: djsrv (dservilla at gmail.com)
Date: 2020-08-05T11:18:24-04:00
Commit Message:
DIRECTOR: LINGO: Fix b_return with no return value
Changed paths:
engines/director/lingo/lingo-builtins.cpp
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 6b318faeb2..fe918b95f2 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -1345,15 +1345,18 @@ void LB::b_quit(int nargs) {
void LB::b_return(int nargs) {
CFrame *fp = g_lingo->_callstack.back();
- Datum retVal = g_lingo->pop();
- g_lingo->_theResult = retVal; // Store result for possible reference
+ Datum retVal;
+ if (nargs > 0) {
+ retVal = g_lingo->pop();
+ g_lingo->_theResult = retVal; // Store result for possible reference
+ }
// clear any temp values from loops
while (g_lingo->_stack.size() > fp->stackSizeBefore)
g_lingo->pop();
// Do not allow a factory's mNew method to return a value
- if (!(g_lingo->_currentMe.type == OBJECT && g_lingo->_currentMe.u.obj->getObjType() == kFactoryObj
+ if (nargs > 0 && !(g_lingo->_currentMe.type == OBJECT && g_lingo->_currentMe.u.obj->getObjType() == kFactoryObj
&& fp->sp.name->equalsIgnoreCase("mNew"))) {
g_lingo->push(retVal);
}
More information about the Scummvm-git-logs
mailing list