gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-commit] /srv/bzr/gnash/avm2 r9690: Prevent null objects from bein


From: Tom Stellard
Subject: [Gnash-commit] /srv/bzr/gnash/avm2 r9690: Prevent null objects from being pushed onto the scope stack.
Date: Mon, 24 Nov 2008 22:26:41 +0800
User-agent: Bazaar (1.5)

------------------------------------------------------------
revno: 9690
committer: Tom Stellard <address@hidden>
branch nick: gnash_dev
timestamp: Mon 2008-11-24 22:26:41 +0800
message:
  Prevent null objects from being pushed onto the scope stack.
modified:
  libcore/vm/Machine.cpp
  libcore/vm/Machine.h
=== modified file 'libcore/vm/Machine.cpp'
--- a/libcore/vm/Machine.cpp    2008-11-17 17:51:21 +0000
+++ b/libcore/vm/Machine.cpp    2008-11-24 14:26:41 +0000
@@ -688,7 +688,14 @@
 /// 0x30 ABC_ACTION_PUSHSCOPE
        case SWF::ABC_ACTION_PUSHSCOPE:
        {
-               push_scope_stack(pop_stack());
+               as_value scope_value = pop_stack();
+               if(!scope_value.to_object().get()){
+                       IF_VERBOSE_ASCODING_ERRORS(
+                       log_aserror(_("Can't push a null value onto the scope 
stack (%s)."), scope_value);
+                       );
+                       scope_value = as_value(new as_object());
+               }       
+               push_scope_stack(scope_value);
                break;
        }
 /// 0x1C ABC_ACTION_PUSHWITH

=== modified file 'libcore/vm/Machine.h'
--- a/libcore/vm/Machine.h      2008-10-27 05:16:17 +0000
+++ b/libcore/vm/Machine.h      2008-11-24 14:26:41 +0000
@@ -290,8 +290,10 @@
        }
 
        void push_scope_stack(as_value object){
+               boost::intrusive_ptr<as_object> scopeObj = object.to_object();
+               assert(scopeObj.get());
                LOG_DEBUG_AVM("Pushing value %s onto scope 
stack.",object.toDebugString());
-               mScopeStack.push(object.to_object());
+               mScopeStack.push(scopeObj);
                print_scope_stack();
        }
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]