Closed Bug 350837 Opened 18 years ago Closed 18 years ago

cx->throwing is not cleared in finally

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: igor, Assigned: igor)

References

Details

(Keywords: regression, verified1.8.0.7, verified1.8.1)

Attachments

(2 files)

Consider the following example:

function f()
{
        print("F");
}

try {
        throw 1;
} finally {
        f.call(this);
}

Currently it does not print f() since finally is executed with cx->throwing set. So js_Interpret quits immediately when f is called. Note that this is only visible with not-inlined calls. If f.call(this) is replaced by f(), then f is executed. I guess this is a regression from bug 3150312.
Attached patch FixSplinter Review
The fix clears cx->throwing in [gosub].
Assignee: general → igor.bukanov
Status: NEW → ASSIGNED
Attachment #236214 - Flags: review?(brendan)
Is this related to bug 350702?
> I guess this is a regression from bug 3150312.

Looks like a typo for bug 350312, "Accessing wrong stack slot with nested catch/finally".
Comment on attachment 236214 [details] [diff] [review]
Fix

Ay caramba!

/be
Attachment #236214 - Flags: review?(brendan)
Attachment #236214 - Flags: review+
Attachment #236214 - Flags: approval1.8.1?
Flags: blocking1.8.1?
Blocks: 350312
Blocks: 350702
I committed the patch from comment 1 to the trunk:

Checking in jsinterp.c;
/cvsroot/mozilla/js/src/jsinterp.c,v  <--  jsinterp.c
new revision: 3.277; previous revision: 3.276
done
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
*** Bug 350702 has been marked as a duplicate of this bug. ***
This is a regression that must be fixed in 1.8.1, and ought to be fixed as soon as possible in 1.8.0.x.

/be
Flags: blocking1.8.0.8?
Flags: blocking1.8.0.7?
Keywords: regression
Attachment #236214 - Flags: approval1.8.0.8?
Attachment #236214 - Flags: approval1.8.0.7?
Comment on attachment 236214 [details] [diff] [review]
Fix

Different patch needed for 1.8.0 branch, coming right up.

/be
Attachment #236214 - Flags: approval1.8.0.8?
Attachment #236214 - Flags: approval1.8.0.7?
Attachment #236300 - Flags: review+
Attachment #236300 - Flags: approval1.8.0.8?
Attachment #236300 - Flags: approval1.8.0.7?
Comment on attachment 236214 [details] [diff] [review]
Fix

a=beltzner on behalf of 181drivers
Attachment #236214 - Flags: approval1.8.1? → approval1.8.1+
Fixed on the 1.8.0 branch with in-person a=dveditz.

/be
Keywords: fixed1.8.0.7
I committed the patch from comment 1 to the MOZILLA_1_8_BRANCH:

Checking in jsinterp.c;
/cvsroot/mozilla/js/src/jsinterp.c,v  <--  jsinterp.c
new revision: 3.181.2.51; previous revision: 3.181.2.50
done
Keywords: fixed1.8.1
Checking in regress-350837.js;
/cvsroot/mozilla/js/tests/js1_5/Exceptions/regress-350837.js,v  <--  regress-350837.js
initial revision: 1.1
Flags: in-testsuite+
Flags: blocking1.8.0.8?
Flags: blocking1.8.0.7?
Flags: blocking1.8.0.7+
Attachment #236300 - Flags: approval1.8.0.8?
Attachment #236300 - Flags: approval1.8.0.7?
Attachment #236300 - Flags: approval1.8.0.7+
verified fixed 1.8, 1.9 20060901 windows/mac*/linux
Status: RESOLVED → VERIFIED
verified fixed 1.8.0.7 2006090118 windows/mac*/linux
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: