Closed
Bug 928029
Opened 11 years ago
Closed 11 years ago
SelfHosting: check ThrowError argument count
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla27
People
(Reporter: pnkfelix, Assigned: pnkfelix)
References
Details
Attachments
(1 file)
1007 bytes,
patch
|
till
:
review+
|
Details | Diff | Splinter Review |
SpiderMonkey does not handle omitted args gracefully in self-hosted calls like ThrowError(JSMSG_PAR_ARRAY_BAD_ARG); the latter needs to be written as ThrowError(JSMSG_PAR_ARRAY_BAD_ARG, "") or you end up with stuff like `strlen(NULL)` because some entries in `errorArgs` were left unfilled. (Patch to catch this in DEBUG builds will be posted shortly.)
Assignee | ||
Comment 1•11 years ago
|
||
Attachment #818620 -
Flags: review?(till)
Assignee | ||
Comment 2•11 years ago
|
||
This fix is not as complete as I would like; e.g. it would be nice to have direct info about which line in the selfhosted code had the erroneous ThrowError call. Also, hypothetically we could attempt to catch this problem while loading the selfhosted code, rather than waiting for the ThrowError invocation to take place. (Still, seems like an worthy change and easy to land now.)
Comment 3•11 years ago
|
||
Comment on attachment 818620 [details] [diff] [review] patch A v1: check arg count matches error-template Review of attachment 818620 [details] [diff] [review]: ----------------------------------------------------------------- This definitely makes sense to land, yes. Can you open a bug about the improvements you mentioned and make it block bug 784288? ::: js/src/vm/SelfHosting.cpp @@ +84,5 @@ > + const JSErrorFormatString *efs = > + js_GetLocalizedErrorMessage(cx, NULL, NULL, errorNumber); > + JS_ASSERT(efs->argCount == args.length() - 1); > +#endif > + Nit: whitespace
Attachment #818620 -
Flags: review?(till) → review+
Assignee | ||
Comment 4•11 years ago
|
||
try build: https://tbpl.mozilla.org/?tree=Try&rev=c8d5a562d49f
Assignee | ||
Comment 5•11 years ago
|
||
pushed to inbound: https://hg.mozilla.org/integration/mozilla-inbound/rev/651ea35bfb0b
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → pnkfelix
Assignee | ||
Updated•11 years ago
|
Flags: in-testsuite-
https://hg.mozilla.org/mozilla-central/rev/651ea35bfb0b
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Assignee | ||
Comment 7•11 years ago
|
||
(In reply to Till Schneidereit [:till] from comment #3) > Can you open a bug about the > improvements you mentioned and make it block bug 784288? Filed as Bug 928943. (I took care of that and forget to link it back here earlier; I've gotten spoiled by github auto-back-refs)
You need to log in
before you can comment on or make changes to this bug.
Description
•