<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Segmentation fault when using a complex path for clip and stroke"
href="https://bugs.freedesktop.org/show_bug.cgi?id=74779#c8">Comment # 8</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Segmentation fault when using a complex path for clip and stroke"
href="https://bugs.freedesktop.org/show_bug.cgi?id=74779">bug 74779</a>
from <span class="vcard"><a class="email" href="mailto:sixtysix@inwind.it" title="Massimo <sixtysix@inwind.it>"> <span class="fn">Massimo</span></a>
</span></b>
<pre>Re the problem caused by using the difference between ptrs:
initially I thought that the problem was that the difference between
raw pointers to stack/heap allocated objects could exceed
2^31 * sizeof(cairo_bo_event_t) and so not representable as an int.
But reading better the code the problem is that you're computing the
difference between addresses of objects of different types
(cairo_bo_start_event_t and cairo_bo_queue_event_t) using pointers to
another type (cairo_bo_event_t).
When the raw difference is not divisible by 'sizeof(cairo_bo_event_t)'
the result is random.
In C, technically, relational operations between pointers are defined
only for pointers to objects from the same array etc. (in C++ it is
possible to use std::less that hides the magic necessary to make it
well defined).
To be on the safe side you'd better cast the pointers to uintptr_t and
return -1 or 0 or 1 for <, ==, >.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
</ul>
</body>
</html>