mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-04 04:03:22 +03:00
Merge topic 'file-READ_MACHO-crash'
6d52fa636f file(READ_MACHO): Avoid crash on unknown archs in this undocumented command
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !12572
This commit is contained in:
commit
76ad67592d
1 file changed
+6
-3
+6
-3
@@ -375,9 +375,12 @@ cmMachO::StringList cmMachO::GetArchitectures() const
|
||||
char const* archName = "unknown";
|
||||
#if __MAC_OS_X_VERSION_MIN_REQUIRED >= 130000
|
||||
if (__builtin_available(macOS 13.0, *)) {
|
||||
archName = (header.CpuType & CPU_TYPE_ARM)
|
||||
? macho_arch_name_for_cpu_type(header.CpuType, header.CpuSubType)
|
||||
: macho_arch_name_for_cpu_type(header.CpuType, CPU_SUBTYPE_MULTIPLE);
|
||||
if (char const* archNameForCpuType = (header.CpuType & CPU_TYPE_ARM)
|
||||
? macho_arch_name_for_cpu_type(header.CpuType, header.CpuSubType)
|
||||
: macho_arch_name_for_cpu_type(header.CpuType,
|
||||
CPU_SUBTYPE_MULTIPLE)) {
|
||||
archName = archNameForCpuType;
|
||||
}
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user