Closed ckormanyos closed 2 years ago
It is present in 1.80 and on develop as well. Seems also like the code has been around for a while.
I have a trivial fix, but need to devise a portable test case (which is somewhat harder).
The issue is triggered by std::array<>::const_iterator being a pointer in gcc, and the fact that you're only importing the first byte of each value and not the whole thing, it's a check for the latter which is missing in the gcc case.
Thank you John!
Well, I ran into the following phenomenon today.
While doing some in-depth testing of
cpp_int
's facility forimport_bits()
, I found what seems to be a potential bug. It is only in GCC, not in MSVC (did not try clang yet).Anyway, when importing a
chunk_size
or 8 from an array of 16-bit unsigned integers, and only formsv_first
beingfalse
, the import function seems to be optimized and imports too large of chunks.I would like to retain the optimization, but maybe it needs improved logic. It seems to be independent of singed/unsigned versions of
char
. Yet I can't quite figure out why MSVC gets it OK, but GCC does not.The entire code is below. The link to Wandbox is here.