Fix undefined behavior: load of misaligned address in atomparsing.h (#1037)
This commit is contained in:
parent
77e1e3cc18
commit
a2f0933d01
|
@ -1,7 +1,7 @@
|
|||
namespace stage2 {
|
||||
namespace atomparsing {
|
||||
|
||||
really_inline uint32_t string_to_uint32(const char* str) { return *reinterpret_cast<const uint32_t *>(str); }
|
||||
really_inline uint32_t string_to_uint32(const char* str) { uint32_t val; std::memcpy(&val, str, sizeof(uint32_t)); return val; }
|
||||
|
||||
WARN_UNUSED
|
||||
really_inline uint32_t str4ncmp(const uint8_t *src, const char* atom) {
|
||||
|
|
Loading…
Reference in New Issue