[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/avm2 r9541: Don't overwrite mExitWithRetur
From: |
Tom Stellard |
Subject: |
[Gnash-commit] /srv/bzr/gnash/avm2 r9541: Don't overwrite mExitWithReturn when we have several nested functions. |
Date: |
Sun, 31 Aug 2008 10:23:49 +0800 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9541
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Sun 2008-08-31 10:23:49 +0800
message:
Don't overwrite mExitWithReturn when we have several nested functions.
modified:
libcore/vm/Machine.cpp
libcore/vm/Machine.h
=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp 2008-08-31 01:43:07 +0000
+++ b/libcore/vm/Machine.cpp 2008-08-31 02:23:49 +0000
@@ -2568,6 +2568,7 @@
mAsValueScopeStack.setAllSizes(s.mScopeTotalSize, s.mScopeStackDepth);
mStream = s.mStream;
mRegisters = s.mRegisters;
+// mExitWithReturn = s.mReturn;
// mDefaultXMLNamespace = s.mDefaultXMLNamespace;
// mCurrentScope = s.mCurrentScope;
// mGlobalReturn = s.mGlobalReturn;
@@ -2591,6 +2592,7 @@
s.mStream = mStream;
s.to_debug_string();
s.mRegisters = mRegisters;
+// s.mReturn = mExitWithReturn;
// s.mDefaultXMLNamespace = mDefaultXMLNamespace;
// s.mCurrentScope = mCurrentScope;
// s.mGlobalReturn = mGlobalReturn;
@@ -2625,14 +2627,16 @@
//todo, this should be fixed.
as_value Machine::executeFunction(CodeStream* stream,const fn_call& fn){
+//TODO: Figure out a good way to use the State object to handle returning
values.
+ bool prev_ext = mExitWithReturn;
+ load_function(stream);
mExitWithReturn = true;
- load_function(stream);
mRegisters[0] = as_value(fn.this_ptr);
for(unsigned int i=0;i<fn.nargs;i++){
mRegisters[i+1] = fn.arg(i);
}
execute();
- mExitWithReturn = false;
+ mExitWithReturn = prev_ext;
return mGlobalReturn;
}
=== modified file 'libcore/vm/Machine.h'
--- a/libcore/vm/Machine.h 2008-08-30 12:19:45 +0000
+++ b/libcore/vm/Machine.h 2008-08-31 02:23:49 +0000
@@ -221,6 +221,7 @@
unsigned int mStackTotalSize;
unsigned int mScopeStackDepth;
unsigned int mScopeTotalSize;
+ bool mReturn;
CodeStream *mStream;
asNamespace *mDefaultXMLNamespace;
as_object *mCurrentScope;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/avm2 r9541: Don't overwrite mExitWithReturn when we have several nested functions.,
Tom Stellard <=