Closed
Bug 710970
Opened 13 years ago
Closed 13 years ago
Possible bad null-check in mjit::Compiler::performCompilation()
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla12
People
(Reporter: Dolske, Assigned: dmandelin)
References
Details
(Whiteboard: [pvs-studio])
Attachments
(1 file)
(deleted),
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
From http://www.viva64.com/en/a/0078/
Example 4. Checking a pointer for NULL only after it had been used
CompileStatus
mjit::Compiler::performCompilation(JITScript **jitp)
{
...
JaegerSpew(JSpew_Scripts,
"successfully compiled (code \"%p\") (size \"%u\")\n",
(*jitp)->code.m_code.executableAddress(),
unsigned((*jitp)->code.m_size));
if (!*jitp)
return Compile_Abort;
...
}
PVS-Studio diagnostic message: V595 The '* jitp' pointer was utilized before it was verified against nullptr. Check lines: 547, 549. compiler.cpp 547
By the way, using a pointer before checking it is a wide-spread error. This was one more example of this kind.
Assignee | ||
Comment 1•13 years ago
|
||
False positive/nit: finishThisUp returns Okay only iff *jitp is non-null.
Assignee: general → dmandelin
Attachment #582111 -
Flags: review?(dvander)
Updated•13 years ago
|
Attachment #582111 -
Flags: review?(dvander) → review-
Comment on attachment 582111 [details] [diff] [review]
Patch
Gah hit wrong button.
Attachment #582111 -
Flags: review- → review+
Assignee | ||
Comment 3•13 years ago
|
||
Target Milestone: --- → mozilla12
Comment 4•13 years ago
|
||
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•