TypeRefID: Only add high bits of a pointer if on 64-bit

Adding another 0 to the TypeRefID bits is useless on 32-bit
platforms.
This commit is contained in:
David Farler
2016-04-25 23:56:08 -07:00
parent 50440abcd0
commit dd7b6635e8

View File

@@ -56,9 +56,11 @@ public:
template <typename T>
void addPointer(const T *Pointer) {
auto Raw = reinterpret_cast<uintptr_t>(Pointer);
Bits.push_back((uint32_t)Raw);
Bits.push_back(Raw >> 32);
auto Raw = reinterpret_cast<uint32_t *>(&Pointer);
Bits.push_back(Raw[0]);
if (sizeof(const T *) > 4) {
Bits.push_back(Raw[1]);
}
}
void addInteger(uint32_t Integer) {