Hello,

After commit bitfields init : tiny solution <https://repo.or.cz/tinycc.git/commit/8cb3e5368ff7c6bf8c58c391acffaff0553e9177> I get bound checking errors.

The reduced code:
struct tmp2 {
  long long int field : 52;
  long long int pad : 12;
};

main()
{
  struct tmp2 tmp2 = {0xFFF000FFF000FLL, 0x123};
  return (0);
}

compiled with 'tcc -b' and run with:
TCC_BOUNDS_PRINT_CALLS=1 ./a.out

gives:
...
bcheck.c, __bound_local_new(): 0x7fff19452670 0x8
bcheck.c, __bound_memset(): 0x7fff19452670, 0, 0x8
bcheck.c, __bound_ptr_add(): 0x7fff19452670 0x8
bcheck.c, __bound_memset(): 0x7fff19452678, 0, 0x2
bcheck.c, __bound_ptr_add(): 0x7fff19452678 0x2
b.c:8: at main: BCHECK: invalid pointer 0x7fff19452678, size 0x2 in memset
bcheck.c, __bound_exit():

The second memset starts at the wrong address.

    Herman

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to