Closed Bug 1258348 Opened 9 years ago Closed 9 years ago

Coverity missing nullcheck in Parser

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1258379

People

(Reporter: jorendorff, Assigned: jorendorff)

Details

Attachments

(1 obsolete file)

________________________________________________________________________________________________________ *** CID 1357072: Null pointer dereferences (REVERSE_INULL) /js/src/frontend/Parser.cpp: 4127 in js::frontend::Parser<js::frontend::FullParseHandler>::bindVar(js::frontend::BindData<js::frontend::FullParseHandler> *, JS::Handle<js::PropertyName *>, js::frontend::Parser<js::frontend::FullParseHandler>*)() 4121 // ensure that functionless scopes get the proper DEFVAR emits.) 4122 parser->handler.setFlag(pn, PND_DEOPTIMIZED); 4123 4124 // Synthesize a new 'var' binding if one does not exist. 4125 DefinitionNode last = pc->decls().lookupLast(name); 4126 Definition::Kind lastKind = parser->handler.getDefinitionKind(last); >>> CID 1357072: Null pointer dereferences (REVERSE_INULL) >>> Null-checking "last" suggests that it may be null, but it has already been dereferenced on all paths leading to the check. 4127 if (last && lastKind != Definition::VAR && lastKind != Definition::ARG) { 4128 parser->handler.setFlag(parser->handler.getDefinitionNode(last), PND_CLOSED); 4129 4130 Node synthesizedVarName = parser->newName(name); 4131 if (!synthesizedVarName) 4132 return false;
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → DUPLICATE
Assignee: nobody → jorendorff
Attachment #8732957 - Attachment is obsolete: true
Attachment #8732957 - Flags: review?(shu)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: