mirror of
				https://github.com/eledio-devices/thirdparty-miniz.git
				synced 2025-10-31 08:42:39 +01:00 
			
		
		
		
	Avoid using unaligned memory access in UBSan builds
This commit is contained in:
		
							
								
								
									
										7
									
								
								miniz.h
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								miniz.h
									
									
									
									
									
								
							| @@ -168,6 +168,13 @@ | |||||||
| #define MINIZ_LITTLE_ENDIAN 0 | #define MINIZ_LITTLE_ENDIAN 0 | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | /* Using unaligned loads and stores causes errors when using UBSan */ | ||||||
|  | #if defined(__has_feature) | ||||||
|  | #if __has_feature(undefined_behavior_sanitizer) | ||||||
|  | #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 0 | ||||||
|  | #endif | ||||||
|  | #endif | ||||||
|  |  | ||||||
| /* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES only if not set */ | /* Set MINIZ_USE_UNALIGNED_LOADS_AND_STORES only if not set */ | ||||||
| #if !defined(MINIZ_USE_UNALIGNED_LOADS_AND_STORES) | #if !defined(MINIZ_USE_UNALIGNED_LOADS_AND_STORES) | ||||||
| #if MINIZ_X86_OR_X64_CPU | #if MINIZ_X86_OR_X64_CPU | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user