[Top][All Lists]
[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: |
strk |
Subject: |
Re: [Gnash-commit] /srv/bzr/gnash/avm2 r9685: Fix segfault caused by null objects in the scope stack. |
Date: |
Mon, 17 Nov 2008 09:25:43 +0100 |
On Mon, Nov 17, 2008 at 04:09:52PM +0800, Tom Stellard wrote:
> On Mon, Nov 17, 2008 at 1:15 AM, strk <address@hidden> wrote:
> > As for the as_error, wrap it always in IF_VERBOSE_ASCODING_ERRORS
> > so any error can also be disabled at compile time.
> > Still, you don't want to abort if user passes a NULL property,
> > so you'd do something like:
> >
> >
> > prop = getProperty();
> > if ( !prop )
> > {
> > IF_VERBOSE_ASCODING_ERRORS(
> > log_aserror(_("..."), ...);
> > );
> > return;
> > }
> > pushStack(prop);
> >
> > --strk;
> >
> >
>
> In this case, if the property is null then nothing is pushed onto the
> stack, this could cause some problems with the following opcodes.
> Anytime AVM2 tries to manipulate the stack it will think there are
> more items on the stack than there actually are. This will cause
> other opcodes to fail in ways that might not be so clear. Is this OK?
Probably not, still push something on the stack if you're expected to.
Undefined most likely.
> Is the current expectation that after an actionscript error the movie
> behavior is undefined?
Well, yes. But it's still worth keeping the stack as much close to
the expected one that possible,so further error messages would
be cleaner.
--strk;