[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] /srv/bzr/gnash/avm2 r9515: Allow abc_functions to return
From: |
Tom Stellard |
Subject: |
[Gnash-commit] /srv/bzr/gnash/avm2 r9515: Allow abc_functions to return a value. |
Date: |
Fri, 22 Aug 2008 17:51:45 +0800 |
User-agent: |
Bazaar (1.5) |
------------------------------------------------------------
revno: 9515
committer: Tom Stellard <address@hidden>
branch nick: gnash_traits
timestamp: Fri 2008-08-22 17:51:45 +0800
message:
Allow abc_functions to return a value.
modified:
libcore/abc_function.cpp
libcore/vm/Machine.cpp
libcore/vm/Machine.h
=== modified file 'libcore/abc_function.cpp'
--- a/libcore/abc_function.cpp 2008-08-22 03:26:02 +0000
+++ b/libcore/abc_function.cpp 2008-08-22 09:51:45 +0000
@@ -32,8 +32,8 @@
abc_function::operator()(const fn_call& fn)
{
log_debug("Calling an abc_function.");
- mMachine->executeFunction(mStream,fn);
- return as_value();
+ return mMachine->executeFunction(mStream,fn);
+
}
=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp 2008-08-22 03:53:14 +0000
+++ b/libcore/vm/Machine.cpp 2008-08-22 09:51:45 +0000
@@ -1239,10 +1239,10 @@
case SWF::ABC_ACTION_RETURNVALUE:
{
// Slot the return.
- *mGlobalReturn = mStack.top(0);
+ mGlobalReturn = pop_stack();
// And restore the previous state.
restoreState();
- break;
+ return;
}
/// 0x49 ABC_ACTION_CONSTRUCTSUPER
/// Stream: V32 'arg_count'
@@ -2603,7 +2603,7 @@
//This is called by abc_functions to execute their code stream.
//TODO: There is probably a better way to do this, once we understand what the
VM is supposed
//todo, this should be fixed.
-void Machine::executeFunction(CodeStream* stream,const fn_call& fn){
+as_value Machine::executeFunction(CodeStream* stream,const fn_call& fn){
mExitWithReturn = true;
load_function(stream);
@@ -2613,6 +2613,7 @@
}
execute();
mExitWithReturn = false;
+ return mGlobalReturn;
}
void Machine::executeCodeblock(CodeStream* stream){
=== modified file 'libcore/vm/Machine.h'
--- a/libcore/vm/Machine.h 2008-08-22 03:53:02 +0000
+++ b/libcore/vm/Machine.h 2008-08-22 09:51:45 +0000
@@ -206,7 +206,7 @@
void initMachine(abc_block* pool_block,as_object* global);
- void executeFunction(CodeStream* stream,const fn_call& fn);
+ as_value executeFunction(CodeStream* stream,const fn_call& fn);
void instantiateClass(std::string className);
@@ -371,7 +371,7 @@
as_object* mDefaultThis;
as_object* mThis;
- as_value *mGlobalReturn;
+ as_value mGlobalReturn;
as_value mIgnoreReturn; // Throw away returns go here.
bool mIsAS3; // Is the stream an AS3 stream.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gnash-commit] /srv/bzr/gnash/avm2 r9515: Allow abc_functions to return a value.,
Tom Stellard <=