Closed
Bug 1489522
Opened 6 years ago
Closed 6 years ago
Possible typo in sizeof expression in builtin/Promise.cpp, and builtin/Array.cpp
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla64
Tracking | Status | |
---|---|---|
firefox64 | --- | fixed |
People
(Reporter: rbartlensky, Assigned: rbartlensky)
References
(Blocks 1 open bug)
Details
(Whiteboard: [CID 1438071][CID 1437483])
Attachments
(1 file)
Coverity points out that the usage of `this` is suspicious in the `sizeof` expression here: https://searchfox.org/mozilla-central/source/js/src/builtin/Promise.cpp#4322 `this` is a pointer, if the author really intended to use `this`, wouldn't it make more sense to use `void*`, so that the intention is clearer? If it is indeed a typo, then I guess the fix is to use `*this` instead of `this`.
Assignee | ||
Updated•6 years ago
|
Flags: needinfo?(arai.unmht)
Comment 1•6 years ago
|
||
yes, it should be *this, or just "PromiseLookup". ArraySpeciesLookup::reset has the same issue. are you going to post patch?
Flags: needinfo?(arai.unmht) → needinfo?(rbartlensky)
Assignee | ||
Comment 2•6 years ago
|
||
(In reply to Tooru Fujisawa [:arai] from comment #1) > yes, it should be *this, or just "PromiseLookup". > ArraySpeciesLookup::reset has the same issue. > > are you going to post patch? Yes, I will also fix the array one here if that is fine with you.
Flags: needinfo?(rbartlensky)
Comment 3•6 years ago
|
||
(In reply to Robert Bartlensky [:rbartlensky] from comment #2) > (In reply to Tooru Fujisawa [:arai] from comment #1) > > yes, it should be *this, or just "PromiseLookup". > > ArraySpeciesLookup::reset has the same issue. > > > > are you going to post patch? > > Yes, I will also fix the array one here if that is fine with you. I'm happy if you fix both of them. thanks! :D
Assignee | ||
Updated•6 years ago
|
Summary: Possible typo in sizeof expression in builtin/Promise.cpp → Possible typo in sizeof expression in builtin/Promise.cpp, and builtin/Array.cpp
Whiteboard: [CID 1438071] → [CID 1438071][CID 1437483]
Assignee | ||
Comment 4•6 years ago
|
||
Comment 5•6 years ago
|
||
Comment on attachment 9007251 [details] Bug 1489522: Fix sizeof typos in js/src/builtin/Promise.cpp and js/src/builtin/Array.cpp. Tooru Fujisawa [:arai] has approved the revision.
Attachment #9007251 -
Flags: review+
Pushed by sledru@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/60c37c0e5083 Fix sizeof typos in js/src/builtin/Promise.cpp and js/src/builtin/Array.cpp. r=arai
Comment 7•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/60c37c0e5083
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox64:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in
before you can comment on or make changes to this bug.
Description
•