Closed Bug 1322458 Opened 3 years ago Closed 3 years ago

Fix KungFuDeathGrip errors that clang plugin reports on Windows

Categories

(Firefox Build System :: Source Code Analysis, defect)

Unspecified
Windows
defect
Not set

Tracking

(firefox53 fixed)

RESOLVED FIXED
mozilla53
Tracking Status
firefox53 --- fixed

People

(Reporter: ting, Unassigned)

References

Details

Attachments

(1 file, 1 obsolete file)

No description provided.
Attached file wip (obsolete) —
Attachment #8817348 - Attachment is obsolete: true
Comment on attachment 8818737 [details]
Bug 1322458 - Fix kungFuDeathGrip errors that clang plugin reports on Windows.

https://reviewboard.mozilla.org/r/98564/#review99002

::: ipc/mscom/WeakRef.cpp:45
(Diff revision 1)
>    }
>    *ppv = nullptr;
>  
>    // Raise the refcount for stabilization purposes during aggregation
>    RefPtr<IUnknown> kungFuDeathGrip(static_cast<IUnknown*>(this));
> +  Unused << kungFuDeathGrip;

Nit: I think if you remove the static_cast here and just pass |this| directly, then the analysis would ignore this instance.  Can you please try that?  If that doesn't work, then the patch is fine as is.

::: widget/windows/TSFTextStore.cpp:1724
(Diff revision 1)
>      mHasReturnedNoLayoutError = false;
>      return;
>    }
>  
>    RefPtr<nsWindowBase> kungFuDeathGrip(mWidget);
> +  Unused << kungFuDeathGrip;

Instead of doing this, you need to give this a better name and use this variable everywhere further down this function instead of mWidget.  This is a legit issue that the analysis has found.  :-)
Attachment #8818737 - Flags: review?(ehsan) → review-
Comment on attachment 8818737 [details]
Bug 1322458 - Fix kungFuDeathGrip errors that clang plugin reports on Windows.

https://reviewboard.mozilla.org/r/98564/#review99142
Attachment #8818737 - Flags: review?(ehsan) → review+
Attachment #8818737 - Flags: review?(aklotz)
Comment on attachment 8818737 [details]
Bug 1322458 - Fix kungFuDeathGrip errors that clang plugin reports on Windows.

https://reviewboard.mozilla.org/r/98564/#review99184

Thanks
Attachment #8818737 - Flags: review?(aklotz) → review+
Pushed by tchou@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/6171fec299c6
Fix kungFuDeathGrip errors that clang plugin reports on Windows. r=aklotz,Ehsan
https://hg.mozilla.org/mozilla-central/rev/6171fec299c6
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla53
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.