Closed
Bug 1472126
Opened 7 years ago
Closed 7 years ago
Remove nullptr JSContext* check from NativeIterator::allocateSentinel() because it's never called with a nulllptr
Categories
(Core :: JavaScript Engine, enhancement, P3)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla63
| Tracking | Status | |
|---|---|---|
| firefox63 | --- | fixed |
People
(Reporter: anba, Assigned: khyperia)
Details
Attachments
(1 file, 2 obsolete files)
|
1.16 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
These lines [1] can be simplied to:
---
if (!ni)
ReportOutOfMemory(maybecx);
---
because the |JSContext*| parameter is never a nullptr. And then the parameter name should be changed from |maybecx| to just |cx|.
[1] https://searchfox.org/mozilla-central/rev/d2966246905102b36ef5221b0e3cbccf7ea15a86/js/src/vm/Iteration.cpp#650-653
Updated•7 years ago
|
Priority: -- → P3
| Assignee | ||
Comment 1•7 years ago
|
||
| Assignee | ||
Updated•7 years ago
|
Assignee: nobody → khyperia
Status: NEW → ASSIGNED
| Assignee | ||
Comment 2•7 years ago
|
||
I believe that the only reference to NativeIterator::allocateSentinel is in ObjectRealm::init [1]. (It's non-null.)
[1] https://searchfox.org/mozilla-central/rev/2466b82b729765fb0a3ab62f812c1a96a7362478/js/src/vm/Realm.cpp#92
Comment 3•7 years ago
|
||
Comment on attachment 9000083 [details] [diff] [review]
require non-null context in NativeIterator::allocateSentinel
Review of attachment 9000083 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good, thanks.
If you post a new patch with r=jandem at the end of the commit message and the style nit below addressed, you can set the r+ flag yourself and add the checkin-needed keyword to the bug so sheriffs will land it. Or request r? if you want another review :)
::: js/src/vm/Iteration.cpp
@@ +660,4 @@
> {
> NativeIterator* ni = js_new<NativeIterator>();
> if (!ni) {
> + ReportOutOfMemory(cx);
Nit: you can remove the {} braces per our coding style [0] (or, maybe better, keep them and add |return nullptr;| on the next line) and we can also rename maybecx to cx in the Iteration.h header file.
https://wiki.mozilla.org/JavaScript:SpiderMonkey:Coding_Style
Attachment #9000083 -
Flags: review+
| Assignee | ||
Comment 4•7 years ago
|
||
| Assignee | ||
Comment 5•7 years ago
|
||
| Assignee | ||
Updated•7 years ago
|
Attachment #9000083 -
Attachment is obsolete: true
| Assignee | ||
Updated•7 years ago
|
Attachment #9001299 -
Attachment is obsolete: true
Updated•7 years ago
|
Attachment #9001329 -
Flags: review+
| Assignee | ||
Updated•7 years ago
|
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/bdea655c3190
Require non-null context in NativeIterator::allocateSentinel. r=jandem
Keywords: checkin-needed
Comment 7•7 years ago
|
||
| bugherder | ||
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in
before you can comment on or make changes to this bug.
Description
•