[cairo] regression in cairo-clip-boxes.c ?

Behdad Esfahbod behdad at behdad.org
Fri Feb 11 18:09:54 UTC 2022


Hi Tobias,

Sounds like unintentinally committed indeed. I created an issue to fix this:

  https://gitlab.freedesktop.org/cairo/cairo/-/issues/534

Doing git blame... later... actually that return looks intentional, if
poorly indented and not committed:


https://gitlab.freedesktop.org/cairo/cairo/-/commit/2d1a137f3d27b60538c58b25e867288c7b0b61bc


behdad
http://behdad.org/


On Fri, Feb 11, 2022 at 10:34 AM Tobias Fleischer (reduxFX) <
tobias.fleischer at reduxfx.com> wrote:

> I just noticed that between Cairo release 1.17.2 and 1.17.4, a suspicious
> looking always return line was added in function
> _cairo_clip_reduce_to_boxes() on line 526 in file cairo-clip-boxes.c :
>
> 1.17.2:
> 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;
>
>     if (clip->path == NULL)
> return clip;
> ...
>
> 1.17.4
> 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;
>     if (clip->path == NULL)
> return clip;
> ...
>
> The additional return before the if condition practically skips the whole
> function.
> Is this intentional?
> Best,
> Toby
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cairographics.org/archives/cairo/attachments/20220211/75a604a1/attachment.htm>


More information about the cairo mailing list