poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: [PATCH] pickles: Add new pickle for jpeg


From: Mohammad-Reza Nabipoor
Subject: Re: Re: [PATCH] pickles: Add new pickle for jpeg
Date: Wed, 31 Jan 2024 13:32:38 +0100

Hi Jose.

On Wed, Jan 31, 2024 at 09:24:45AM +0100, Jose E. Marchesi wrote:
> 
> >> +    byte ff == 0xFF;
> >> +    byte xx : xx != 0xD8 && xx != 0xDA && xx != 0xD9 && xx >= 0xC0 && xx 
> >> < 0xFF;
> >> +    uint16 size;
> >> +    char[size-2] data;
> >
> >
> > `size-2' is not a good idea because you cannot guarantee that `size' is 
> > always
> > `>= 2' and this happens:
> >
> > ```
> > (poke) var size = 0UH
> > (poke) size - 2
> > 4294967294U
> > ```
> >
> > which is not easy to debug!
> 
> But you can use
> 
>   uint16 size : size >= 2;
>   char[size >= 2 ? size - 2 : 0] data;
> 
> The conditional expression in the array size is to allow non-strict
> mappings @!.
> 


Yeah! That's what I meant, to add some conditional, but I didn't communicate
it clearly.  My bad.  Thanks for the clarification.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]