diff options
author | Lasse Collin <lasse.collin@tukaani.org> | 2024-04-10 21:59:27 +0300 |
---|---|---|
committer | Lasse Collin <lasse.collin@tukaani.org> | 2024-04-10 23:12:23 +0300 |
commit | 1024cd4cd966b998fedec51e385e9ee9a49b3c57 (patch) | |
tree | e0a0ce04f567fe00e9a7901ad6bcfdd1a913cd60 | |
parent | liblzma: ARM64 CRC32: Use negation instead of subtracting from 8 (diff) | |
download | xz-1024cd4cd966b998fedec51e385e9ee9a49b3c57.tar.xz |
liblzma: ARM64 CRC32: Add error checking to FreeBSD-specific code
Also add parenthesis to the return statement.
I didn't test this.
Fixes: 761f5b69a4c778c8bcb09279b845b07c28790575
-rw-r--r-- | src/liblzma/check/crc32_arm64.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/liblzma/check/crc32_arm64.h b/src/liblzma/check/crc32_arm64.h index cd1b355f..68e7fcdd 100644 --- a/src/liblzma/check/crc32_arm64.h +++ b/src/liblzma/check/crc32_arm64.h @@ -84,8 +84,10 @@ is_arch_extension_supported(void) #elif defined(HAVE_ELF_AUX_INFO) unsigned long feature_flags; - elf_aux_info(AT_HWCAP, &feature_flags, sizeof(feature_flags)); - return feature_flags & HWCAP_CRC32 != 0; + if (elf_aux_info(AT_HWCAP, &feature_flags, sizeof(feature_flags)) != 0) + return false; + + return (feature_flags & HWCAP_CRC32) != 0; #elif defined(_WIN32) return IsProcessorFeaturePresent( |