lean4-htt/src/include/lean
Thomas Köppe 91c14c7ee9
fix: only consider salient bytes in sharecommon eq, hash (#5840)
This PR changes `lean_sharecommon_{eq,hash}` to only consider the
salient bytes of an object, and not any bytes of any
unspecified/uninitialized unused capacity.

Accessing uninitialized storage results in undefined behaviour.

This does not seem to have any semantics disadvantages: If objects
compare equal after this change, their salient bytes are still equal. By
contrast, if the actual identity of allocations needs to be
distinguished, that can be done by just comparing pointers to the
storage.

If we wanted to retain the current logic, we would need initialize the
otherwise unused parts to some specific value to avoid the undefined
behaviour.

Closes #5831
2024-11-19 13:56:46 +00:00
..
lean.h fix: only consider salient bytes in sharecommon eq, hash (#5840) 2024-11-19 13:56:46 +00:00
lean_gmp.h fix: do not dllexport symbols in core static libraries (#3601) 2024-03-15 11:58:34 +00:00
lean_libuv.h feat: link LibUV (#4963) 2024-08-12 12:33:24 +00:00