forked from OSchip/llvm-project
[ORC-RT] Fix objc selector corruption
We were writing a pointer to a selector string into the contents of a string instead of overwriting the pointer to the string, leading to corruption. This was causing non-deterministic failures of the 'trivial-objc-methods' test case. Differential Revision: https://reviews.llvm.org/D112671
This commit is contained in:
parent
d378a0febc
commit
beb3d48262
|
@ -112,10 +112,10 @@ Error registerObjCSelectors(
|
|||
if (auto Err = validatePointerSectionExtent("__objc_selrefs", ObjCSelRefs))
|
||||
return Err;
|
||||
|
||||
for (uintptr_t SelEntry : ObjCSelRefs.toSpan<uintptr_t>()) {
|
||||
for (uintptr_t &SelEntry : ObjCSelRefs.toSpan<uintptr_t>()) {
|
||||
const char *SelName = reinterpret_cast<const char *>(SelEntry);
|
||||
auto Sel = sel_registerName(SelName);
|
||||
*reinterpret_cast<SEL *>(SelEntry) = Sel;
|
||||
*reinterpret_cast<SEL *>(&SelEntry) = Sel;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue