orc icon indicating copy to clipboard operation
orc copied to clipboard

Prefer `memcpy` to cast of unaligned pointer

Open fosterbrereton opened this issue 3 years ago • 2 comments

Provide an unaligned_read routine for reading integers at any memory address, not just those that are at language-prescribed alignment offsets. The solution is to use memcpy, which the compiler will optimize away as able. Fixes #49.

fosterbrereton avatar Sep 01 '22 14:09 fosterbrereton

UBSan test is coming back clean (though even if it didn't, it's not reporting properly as per #50)

fosterbrereton avatar Sep 01 '22 15:09 fosterbrereton

Do you mind patching up the other unaligned reads in string_pool.cpp? Then everything would be tidy and consistent.

leethomason avatar Sep 01 '22 18:09 leethomason