Skip to content

Commit b2adefc

Browse files
committed
[compiler-rt][ubsan][nfc-ish] Fix a type conversion bug
With llvm#100483, if the inline asm version of `ptrauth_strip` is used instead of the builtin, the inline asm implementation will return an unsigned long, causing an incompatible pointer conversion issue.
1 parent 4ed543d commit b2adefc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ struct VtablePrefix {
207207
std::type_info *TypeInfo;
208208
};
209209
VtablePrefix *getVtablePrefix(void *Vtable) {
210-
Vtable = ptrauth_strip(Vtable, ptrauth_key_cxx_vtable_pointer);
210+
Vtable = reinterpret_cast<void *>(
211+
ptrauth_strip(Vtable, ptrauth_key_cxx_vtable_pointer));
211212
VtablePrefix *Vptr = reinterpret_cast<VtablePrefix*>(Vtable);
212213
VtablePrefix *Prefix = Vptr - 1;
213214
if (!IsAccessibleMemoryRange((uptr)Prefix, sizeof(VtablePrefix)))

0 commit comments

Comments
 (0)