GNOME Bugzilla – Bug 778304
Unreachable code if catch {} path returns
Last modified: 2018-05-22 15:44:38 UTC
Created attachment 345138 [details] reproducer If a function has a try{} catch(){} block where either code block returns a value or throws a different kind of error, the "goto __finallyX;" call at the end of it is made unreachable, for the example attachment: gchar* foo_bar (Foo* self, GError** error) { ... { ... _tmp1_ = g_file_read_link ("/home", &_inner_error_); _tmp0_ = _tmp1_; if (G_UNLIKELY (_inner_error_ != NULL)) { goto __catch0_g_error; } ... return result; } goto __finally0; __catch0_g_error: ... __finally0: ... } This triggers a number of Coverity warnings for Tracker, the CIDs are: 1388519, 1388518, 1388517, 1388516, 1388515, 1388514, 1388512, 1388511, 1388509, 1388508, 1388500, 1388492, 1388484, 1388483.
Created attachment 346125 [details] [review] errormodule: Don't write unreachable goto-statement
Comment on attachment 346125 [details] [review] errormodule: Don't write unreachable goto-statement Only the first goto can be dropped not all.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/vala/issues/577.