Closed
Bug 380016
Opened 18 years ago
Closed 18 years ago
Catchguard decompilation includes "/*EXCEPTION*/"
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
VERIFIED
FIXED
People
(Reporter: jruderman, Assigned: mrbkap)
References
Details
(Keywords: regression, testcase)
Attachments
(2 files, 2 obsolete files)
2.27 KB,
patch
|
brendan
:
review+
|
Details | Diff | Splinter Review |
2.27 KB,
patch
|
Details | Diff | Splinter Review |
js> function() { try { } catch(e if x) { } }
function () {
try {
} catch (e if x) {
/*EXCEPTION*/;
}
}
Comment 3•18 years ago
|
||
ditto
js1_5/extensions/regress-374589.js
js1_7/decompilation/regress-355105.js
js1_7/decompilation/regress-375794.js
Assignee | ||
Comment 4•18 years ago
|
||
The problem here is that an unannotated JSOP_POP simply decompiles whatever's on the stack. In this case, we want to really pop the exception cookie. It appears that we need to annotate the JSOP_POP emitted for the catchguard (for the DUP, I think) in some way so the decompiler simply pops and throws away the result.
Assignee | ||
Comment 5•18 years ago
|
||
Comment 6•18 years ago
|
||
Comment on attachment 264380 [details] [diff] [review]
Something like this
Even easier: check for exception_cookie in the default JSOP_POP code and discard it. There's no way to generate such a comment that the decompiler could pop.
/be
Assignee | ||
Comment 7•18 years ago
|
||
Attachment #264380 -
Attachment is obsolete: true
Attachment #264393 -
Flags: review?(igor)
Attachment #264380 -
Flags: review?(igor)
Comment 8•18 years ago
|
||
Comment on attachment 264393 [details] [diff] [review]
Easier
Sorry for driving by again: one thought is to exclude all non-empty strings that start with "/*".
/be
Comment 9•18 years ago
|
||
Comment on attachment 264393 [details] [diff] [review]
Easier
I would prefer comments explaining why empty string and the exception cookie are special.
Comment 10•18 years ago
|
||
(In reply to comment #8)
> (From update of attachment 264393 [details] [diff] [review])
> Sorry for driving by again: one thought is to exclude all non-empty strings
> that start with "/*".
I would prefer to keep the check as in Blake's patch but add an assert after it to ensure that the string does not start from "/*" or any other invalid chars at that point.
Comment 11•18 years ago
|
||
(In reply to comment #10)
> (In reply to comment #8)
> > (From update of attachment 264393 [details] [diff] [review] [details])
> > Sorry for driving by again: one thought is to exclude all non-empty strings
> > that start with "/*".
>
> I would prefer to keep the check as in Blake's patch but add an assert after it
> to ensure that the string does not start from "/*" or any other invalid chars
> at that point.
Yeah, I considered that but tilted back toward silently popping any cookie. On reflection your preferred plan seems best to me, though.
/be
Comment 12•18 years ago
|
||
(In reply to comment #11)
> Yeah, I considered that but tilted back toward silently popping any cookie. On
> reflection your preferred plan seems best to me, though.
An alternative is to check for /* and then assert that is the exception cookie.
Comment 13•18 years ago
|
||
(In reply to comment #12)
> (In reply to comment #11)
> > Yeah, I considered that but tilted back toward silently popping any cookie. On
> > reflection your preferred plan seems best to me, though.
>
> An alternative is to check for /* and then assert that is the exception cookie.
Best yet ;-).
/be
Updated•18 years ago
|
OS: Mac OS X → All
Hardware: PC → All
Assignee | ||
Comment 14•18 years ago
|
||
I think this is the smallest patch that has the desired behavior.
Attachment #264393 -
Attachment is obsolete: true
Attachment #265168 -
Flags: review?(brendan)
Attachment #264393 -
Flags: review?(igor)
Comment 15•18 years ago
|
||
Comment on attachment 265168 [details] [diff] [review]
With the assertion
>+ if (*rval != '\0' && (rval[0] != '/' || rval[1] != '*')) {
>+
Nit: lose this blank line.
r=me with that.
/be
Attachment #265168 -
Flags: review?(brendan) → review+
Assignee | ||
Comment 16•18 years ago
|
||
Assignee | ||
Comment 17•18 years ago
|
||
This was checked in on trunk.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•