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)

defect
Not set
normal

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`.
Flags: needinfo?(arai.unmht)
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)
(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)
(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
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]
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
https://hg.mozilla.org/mozilla-central/rev/60c37c0e5083
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: