Closed
Bug 723530
Opened 14 years ago
Closed 13 years ago
double error reporting in ctype JS api implementation
Categories
(Core :: js-ctypes, defect)
Tracking
()
RESOLVED
FIXED
mozilla15
People
(Reporter: igor, Assigned: capella)
Details
(Whiteboard: [mentor=jdm][lang=c++])
Attachments
(1 file)
13.64 KB,
patch
|
bholley
:
review+
jdm
:
feedback+
|
Details | Diff | Splinter Review |
In many places ctypes implementation contains the following code:
JSObject* obj = JS_THIS_OBJECT(cx, vp);
if (!obj || !(CType::IsCType(obj) || CType::IsCTypeProto(obj))) {
JS_ReportError(cx, "not a CType");
return JS_FALSE;
}
That is, the error is reported when JS_THIS_OBJECT(cx, vp) returns false. However, JS_THIS_OBJECT(cx, vp) already reports an error when it fails leading to bogus second error report and stopping of OOM propagation that triggered JS_THIS_OBJECT failure.
Comment 1•14 years ago
|
||
I assume the correct fix is to move the null check out of the condition and into an early return?
Whiteboard: [mentor=jdm][lang=c++]
Reporter | ||
Comment 2•14 years ago
|
||
(In reply to Josh Matthews [:jdm] from comment #1)
> I assume the correct fix is to move the null check out of the condition and
> into an early return?
Yes
Assignee | ||
Comment 3•13 years ago
|
||
Have a look at the patch, I think it's what you're after.
It builds clean and mochitest-plain passes locally on my WIN7 machine.
Comment 4•13 years ago
|
||
Comment on attachment 619146 [details] [diff] [review]
Patch (v1)
Yep, that looks right to me. Onwards, brave reviewers!
Attachment #619146 -
Flags: review?(bobbyholley+bmo)
Attachment #619146 -
Flags: feedback?(josh)
Attachment #619146 -
Flags: feedback+
Updated•13 years ago
|
Attachment #619146 -
Flags: review?(bobbyholley+bmo) → review+
Comment 5•13 years ago
|
||
Target Milestone: --- → mozilla15
Comment 6•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•