gnash-commit
[Top][All Lists]
Advanced

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

Re: [Gnash-commit] /srv/bzr/gnash/avm2 r9685: Fix segfault caused by nul


From: Tom Stellard
Subject: Re: [Gnash-commit] /srv/bzr/gnash/avm2 r9685: Fix segfault caused by null objects in the scope stack.
Date: Sat, 15 Nov 2008 11:41:54 +0800

On Sat, Nov 15, 2008 at 4:36 AM, strk <address@hidden> wrote:
> On Sat, Nov 15, 2008 at 02:19:01AM +0800, Tom Stellard wrote:
>> ------------------------------------------------------------
>> revno: 9685
>> committer: Tom Stellard <address@hidden>
>> branch nick: gnash_dev
>> timestamp: Sat 2008-11-15 02:19:01 +0800
>> message:
>>   Fix segfault caused by null objects in the scope stack.
>> modified:
>>   libcore/as_environment.cpp
>>   libcore/vm/Machine.cpp
>
>> === modified file 'libcore/as_environment.cpp'
>> --- a/libcore/as_environment.cpp      2008-11-06 19:04:35 +0000
>> +++ b/libcore/as_environment.cpp      2008-11-14 18:19:01 +0000
>> @@ -679,6 +679,7 @@
>>                               {
>>                                       // const_cast needed due to non-const 
>> as_object::get_member
>>                                       as_object* obj = 
>> const_cast<as_object*>((*scopeStack)[i-1].get());
>> +                                     if(!obj) continue;
>
> Shouldn't we avoid putting NULLs in the scope stack instead ?
> How did it get there ?
>
> --strk;
>

NULLs are added to the scope stack when AVM2 can't find the object it
is looking for.  This usually happens when there is an unimplemented
actionscript class, or when AVM2 didn't create an object when it was
supposed to.  I think I could probably add code in push_scope_stack()
that prevents NULL objects from being added to the scope stack.

-Tom




reply via email to

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