Hi,

On 20.12.2016 04:23, He Junyan wrote:

>>> +    if (!CL_OBJECT_IS_BUFFER(memobj)) {

>> That would match pipes as well, is that intended?

> Already redefine CL_OBJECT_IS_BUFFER to just match buffer and subbuffer.

> +#define CL_OBJECT_IS_BUFFER(mem) ((mem &&                                    
>              \
> +                                   ((cl_base_object)mem)->magic == 
> CL_OBJECT_MEM_MAGIC && \
> +                                   CL_OBJECT_GET_REF(mem) >= 1 &&            
>              \
> +                                   ((cl_mem)mem)->type <= 
> CL_MEM_SUBBUFFER_TYPE))

Exactly my point. A pipe object would not match CL_OBJECT_IS_BUFFER(),
so the negated test would return true, and the code would look at
memobj->host_ptr in a pipe object, which is wrong.

   Simon


Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to