RESOLVED FIXED188983
[GTK][JSC] Add warn_unused_result attribute to some APIs
https://bugs.webkit.org/show_bug.cgi?id=188983
Summary [GTK][JSC] Add warn_unused_result attribute to some APIs
Patrick Griffis
Reported 2018-08-27 07:38:28 PDT
[GTK][JSC] Add warn_unused_result attribute to some APIs
Attachments
Patch (2.68 KB, patch)
2018-08-27 07:38 PDT, Patrick Griffis
no flags
Patrick Griffis
Comment 1 2018-08-27 07:38:56 PDT
Michael Catanzaro
Comment 2 2018-08-27 09:12:50 PDT
Normally I would leave this to Carlos Garcia, but he is quite busy this week and it's clearly a good improvement.
Michael Catanzaro
Comment 3 2018-08-27 09:13:21 PDT
P.S. I assume this doesn't add build warnings in WebKit's own build!
Michael Catanzaro
Comment 4 2018-08-27 09:15:46 PDT
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().
WebKit Commit Bot
Comment 5 2018-08-27 09:39:19 PDT
Comment on attachment 348143 [details] Patch Clearing flags on attachment: 348143 Committed r235373: <https://trac.webkit.org/changeset/235373>
WebKit Commit Bot
Comment 6 2018-08-27 09:39:20 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 7 2018-08-27 09:40:22 PDT
Carlos Garcia Campos
Comment 8 2018-09-03 00:18:07 PDT
Thanks! There are more cases like evaluate functions.
Note You need to log in before you can comment on or make changes to this bug.