On Thu, Aug 31, 2023 at 8:26 PM Michael Shavit <msha...@google.com> wrote: > > On Thu, Aug 31, 2023 at 6:57 PM Rob Landley <r...@landley.net> 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 && (data = atollu(toys.optargs[2]))>(~0LL)>>(64-8*bytes)) > > Shouldn't it be (~0ULL)? I think (~0LL) would make this an arithmetic > shift instead of a logical shift.
The `devmem 0x000000008b300000 4 0x1FFFFFFFF` testcase doesn't detect and print an error because of this issue. But your change with (~0LL) changed to (~0ULL) does pass all the test cases previously mentioned. _______________________________________________ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net