Summary: | [GTK][JSC] Add warn_unused_result attribute to some APIs | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Patrick Griffis <pgriffis> | ||||
Component: | New Bugs | Assignee: | Nobody <webkit-unassigned> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | bugs-noreply, cgarcia, commit-queue, ews-watchlist, keith_miller, mark.lam, mcatanzaro, msaboff, saam, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | WebKit Nightly Build | ||||||
Hardware: | Unspecified | ||||||
OS: | Unspecified | ||||||
Attachments: |
|
Description
Patrick Griffis
2018-08-27 07:38:28 PDT
Created attachment 348143 [details]
Patch
Normally I would leave this to Carlos Garcia, but he is quite busy this week and it's clearly a good improvement. P.S. I assume this doesn't add build warnings in WebKit's own build! Rationale: programmers intuitively expect that it is safe to ignore the return value of a function call if the result is unneeded or void. But, as Patrick discovered, this leads to memory leaks if you think you can get away with that when using jsc_value_object_invoke_method() or jsc_value_function_call(). Comment on attachment 348143 [details] Patch Clearing flags on attachment: 348143 Committed r235373: <https://trac.webkit.org/changeset/235373> All reviewed patches have been landed. Closing bug. Thanks! There are more cases like evaluate functions. |