Index: compiler-rt/lib/orc/macho_platform.cpp =================================================================== --- compiler-rt/lib/orc/macho_platform.cpp +++ compiler-rt/lib/orc/macho_platform.cpp @@ -112,10 +112,10 @@ if (auto Err = validatePointerSectionExtent("__objc_selrefs", ObjCSelRefs)) return Err; - for (uintptr_t SelEntry : ObjCSelRefs.toSpan()) { + for (uintptr_t &SelEntry : ObjCSelRefs.toSpan()) { const char *SelName = reinterpret_cast(SelEntry); auto Sel = sel_registerName(SelName); - *reinterpret_cast(SelEntry) = Sel; + *reinterpret_cast(&SelEntry) = Sel; } }