Bug 104136 - _cairo_clip_reduce_to_boxes appears to have a merge bug; it returns early
Summary: _cairo_clip_reduce_to_boxes appears to have a merge bug; it returns early
Status: RESOLVED MOVED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Chris Wilson
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-12-05 19:02 UTC by Arlie Davis
Modified: 2018-08-25 13:47 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Arlie Davis 2017-12-05 19:02:08 UTC
While reading code, I noticed that the function _cairo_clip_reduce_to_boxes appears to have an extra "return clip;" in it.  This is the first (non-declaration) statement in the function, and so the function does nothing at all except for return the value of its input argument "clip".  The code:

static cairo_clip_t *
_cairo_clip_reduce_to_boxes (cairo_clip_t *clip)
{
    struct reduce r;
    cairo_clip_path_t *clip_path;
    cairo_status_t status;

	return clip;            // <-- THIS LOOKS BOGUS
    if (clip->path == NULL)
	return clip;

    r.clip = clip;
    r.extents.p1.x = r.extents.p1.y = INT_MAX;
    r.extents.p2.x = r.extents.p2.y = INT_MIN;



I checked the Git history, and this bug has been there from the first commit which added this file.
Comment 1 songwentai 2018-07-21 11:01:18 UTC
please fix it
Comment 2 GitLab Migration User 2018-08-25 13:47:04 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org'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.freedesktop.org/cairo/cairo/issues/192.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.