Commit a76d34f2 authored by Kenton Varda's avatar Kenton Varda Committed by GitHub

Merge pull request #547 from dwrensha/ubsan-left-shift

ubsan: cast to unsigned integer before performing left shift
parents d7fd57be d7cb5b44
......@@ -158,7 +158,7 @@ struct WirePointer {
reinterpret_cast<uintptr_t>(segment->getStartPtr()));
KJ_DREQUIRE(reinterpret_cast<uintptr_t>(target) <=
reinterpret_cast<uintptr_t>(segment->getStartPtr() + segment->getSize()));
offsetAndKind.set(((target - reinterpret_cast<word*>(this) - 1) << 2) | kind);
offsetAndKind.set((static_cast<uint32_t>(target - reinterpret_cast<word*>(this) - 1) << 2) | kind);
}
KJ_ALWAYS_INLINE(void setKindWithZeroOffset(Kind kind)) {
offsetAndKind.set(kind);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment