bugGnash - The GNU Flash player - Bugs: bug #33754, ActionAddTyped with short stack

 
 

bug #33754: ActionAddTyped with short stack

Submitted by:  Sandro Santilli <strk>
Submitted on:  Tue 12 Jul 2011 01:40:49 PM UTC  
 
Category: ActionScriptSeverity: 3 - Normal
Release: masterStatus: Fixed
Privacy: PublicAssigned to: Sandro Santilli <strk>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Sat 16 Jul 2011 03:53:11 PM UTC, comment #5:

Fixed with 47d994a

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sat 16 Jul 2011 03:42:13 PM UTC, comment #4:

I suspect we have this problem for every opcode.
Problem is we assume there's stuff on the stack, so rather than doing pop,pop and push we take references to the operators from the stack, override the second-to-last as the return and we drop the last one.

When the stack doesn't have those items we basically override a temporary as_value (not on the stack) and we drop the last one (possibly the only one on the stack).

Proper solution here would be either checking how many items we have or just pop,pop,push ...

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sat 16 Jul 2011 03:33:38 PM UTC, comment #3:

I've committed an automated test for this in 806b40c

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sat 16 Jul 2011 02:51:42 PM UTC, comment #2:

Well, the gnash bug is still only for shortstack, as in presence of explicit undefined values it beaves as it should (see 3de8edb6f3f444e3810047cdf172466c55bed4a4).

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sat 16 Jul 2011 02:11:20 PM UTC, comment #1:

I've found it's not about short stack but undefined values in general:

"A" + undef = "A" (gnash gets undef)
undef + undef = 0 (gnash gets undef)

Sandro Santilli <strk>
Project MemberIn charge of this item.
Tue 12 Jul 2011 01:40:49 PM UTC, original submission:

When ActionNewAdd (or AddTyped, as known by swfmill) is encountered while a single item is on the stack, the stack should be left with that single item. Currently the stack is cleared instead.

Would be simple to test with swfmill...

Sandro Santilli <strk>
Project MemberIn charge of this item.

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by strk (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 16 Jul 2011 03:53:11 PM UTCstrkStatusConfirmed=>Fixed
      Assigned toNone=>strk
      Open/ClosedOpen=>Closed
    Sat 16 Jul 2011 03:33:38 PM UTCstrkStatusNone=>Confirmed
    Sat 16 Jul 2011 02:51:42 PM UTCstrkSummaryActionAddTyped with undefined values=>ActionAddTyped with short stack
    Sat 16 Jul 2011 02:11:20 PM UTCstrkSummaryActionAddTyped with short stack=>ActionAddTyped with undefined values

    Back to the top


    Powered by Savane 3.1-cleanup1