the attached patch gives us your nice "%lx>%d bytes" error for all cases.
On Mon, Oct 9, 2023 at 9:42 PM Rob Landley wrote:
>
> On 10/9/23 17:04, enh wrote:
> > On Mon, Oct 9, 2023 at 2:45 PM Rob Landley wrote:
> >>
> >> On 10/9/23 10:26, enh wrote:
> >> >> Let me know how commit 5f153b56214f wo
On 10/9/23 17:04, enh wrote:
> On Mon, Oct 9, 2023 at 2:45 PM Rob Landley wrote:
>>
>> On 10/9/23 10:26, enh wrote:
>> >> Let me know how commit 5f153b56214f works? I don't have a test environment
>> >> for this, but it seems to produce the errors right on 32 and 64 bit at
>> >> least...
>> >
>> >
On Mon, Oct 9, 2023 at 2:45 PM Rob Landley wrote:
>
> On 10/9/23 10:26, enh wrote:
> >> Let me know how commit 5f153b56214f works? I don't have a test environment
> >> for this, but it seems to produce the errors right on 32 and 64 bit at
> >> least...
> >
> > it's a bit early in the morning for m
On 10/9/23 10:26, enh wrote:
>> Let me know how commit 5f153b56214f works? I don't have a test environment
>> for this, but it seems to produce the errors right on 32 and 64 bit at
>> least...
>
> it's a bit early in the morning for me, but doesn't the change from
> `unsigned long long` to `unsigne
it's a bit early in the morning for me, but doesn't the change from
`unsigned long long` to `unsigned long` mean that by the time you test
the result it can't be too large because you've already truncated?
On Sat, Oct 7, 2023 at 11:39 PM Rob Landley wrote:
>
> On 10/6/23 14:59, enh wrote:
> > On
On 10/6/23 14:59, enh wrote:
> On Fri, Oct 6, 2023 at 12:35 PM Michael Shavit via Toybox
> wrote:
>>
>> On Fri, Oct 6, 2023 at 4:41 AM Rob Landley wrote:
>> >
>> > I could adjust _just_ addr to use unsigned long instead of unsigned long
>> > long,
>> > but I don't want two atollu()/atolu() and l
On Fri, Oct 6, 2023 at 12:35 PM Michael Shavit via Toybox
wrote:
>
> On Fri, Oct 6, 2023 at 4:41 AM Rob Landley wrote:
> >
> > I could adjust _just_ addr to use unsigned long instead of unsigned long
> > long,
> > but I don't want two atollu()/atolu() and letting you do a longer address
> > and
On Fri, Oct 6, 2023 at 4:41 AM Rob Landley wrote:
>
> I could adjust _just_ addr to use unsigned long instead of unsigned long long,
> but I don't want two atollu()/atolu() and letting you do a longer address and
> silently truncating it isn't great either. Also, a 32-bit platform can't do an
> at
On 8/31/23 02:00, Michael Shavit via Toybox wrote:
> Replace the left-shift method of computing the maximum allowed write as
> it may exibit undefined behavior.
> Add and use an unsigned version of atolx to support writing any 64bit
> value.
>
> * When bytes equals 8, devmem will left-shift an uns
LGTM! Thanks :) .
On Tue, Sep 19, 2023 at 4:34 AM Rob Landley wrote:
>
> On 9/18/23 18:08, Michael Shavit wrote:
> > On Thu, Aug 31, 2023 at 3:57 AM Rob Landley wrote:
> >> +unsigned long long atollu(char *str)
> >> +{
> >> + char *end = str;
> >> + unsigned long long llu = strtoul(str, &end,
On 9/18/23 18:08, Michael Shavit wrote:
> On Thu, Aug 31, 2023 at 3:57 AM Rob Landley wrote:
>> +unsigned long long atollu(char *str)
>> +{
>> + char *end = str;
>> + unsigned long long llu = strtoul(str, &end, 0);
>
> Sorry I didn't notice this earlier, but hort...@google.com pointed out
> tha
On Thu, Aug 31, 2023 at 3:57 AM Rob Landley wrote:
> +unsigned long long atollu(char *str)
> +{
> + char *end = str;
> + unsigned long long llu = strtoul(str, &end, 0);
Sorry I didn't notice this earlier, but hort...@google.com pointed out
that we should be using strtoull() here. This supposedl
On Fri, Sep 1, 2023 at 5:24 AM Rob Landley wrote:
>
> On 8/31/23 13:38, Michael Shavit wrote:
> > On Thu, Aug 31, 2023 at 8:26 PM Michael Shavit wrote:
> >>
> >> On Thu, Aug 31, 2023 at 6:57 PM Rob Landley wrote:
> >> >
> >> >// DATA? Report out of range values as errors rather than truncati
On Fri, Sep 1, 2023 at 5:13 AM Rob Landley wrote:
>
> On 8/31/23 07:26, Michael Shavit wrote:
> > On Thu, Aug 31, 2023 at 6:57 PM Rob Landley wrote:
> >> Could you send me the test case you hit that motivated this change? (I
> >> haven't
> >> got a tests/devmem.test yet and am not 100% sure how
On 8/31/23 13:38, Michael Shavit wrote:
> On Thu, Aug 31, 2023 at 8:26 PM Michael Shavit wrote:
>>
>> On Thu, Aug 31, 2023 at 6:57 PM Rob Landley wrote:
>> >
>> >// DATA? Report out of range values as errors rather than truncating.
>> > - if (writing) data = atolx_range(toys.optargs[2], 0,
On 8/31/23 07:26, Michael Shavit wrote:
> On Thu, Aug 31, 2023 at 6:57 PM Rob Landley wrote:
>> Could you send me the test case you hit that motivated this change? (I
>> haven't
>> got a tests/devmem.test yet and am not 100% sure how I'd even set that up in
>> mkroot under qemu, but I should work
Replace the left-shift method of computing the maximum allowed write as
it may exibit undefined behavior.
Add and use an unsigned version of atolx to support writing any 64bit
value.
* When bytes equals 8, devmem will left-shift an unsigned long long by
64 bits which is undefined behavior if siz
On Thu, Aug 31, 2023 at 6:57 PM Rob Landley wrote:
>
> On 8/31/23 02:00, Michael Shavit wrote:
> > Replace the left-shift method of computing the maximum allowed write as
> > it may exibit undefined behavior.
> > Add and use an unsigned version of atolx to support writing any 64bit
> > value.
> >
On Thu, Aug 31, 2023 at 8:26 PM Michael Shavit wrote:
>
> On Thu, Aug 31, 2023 at 6:57 PM Rob Landley wrote:
> >
> >// DATA? Report out of range values as errors rather than truncating.
> > - if (writing) data = atolx_range(toys.optargs[2], 0, (1ULL<<(8*bytes))-1);
> > + if (writing && (dat
On 8/31/23 02:00, Michael Shavit wrote:
> Replace the left-shift method of computing the maximum allowed write as
> it may exibit undefined behavior.
> Add and use an unsigned version of atolx to support writing any 64bit
> value.
>
> * When bytes equals 8, devmem will left-shift an unsigned long
20 matches
Mail list logo