mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:42:43 +00:00 
			
		
		
		
	LibCrypto: Add workaround for false -Warray-bounds warning
When building for AArch64 with UBSan enabled, GCC 13.1 reports a false "array out of bounds" error on access to offset `1 * sizeof(u64)`. Changing the order of the stores seems to silence it.
This commit is contained in:
		
							parent
							
								
									6bcd73a2ff
								
							
						
					
					
						commit
						12a2f741a7
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		|  | @ -40,10 +40,10 @@ static void export_big_endian(u256 const& value, Bytes data) | |||
|     u64 c = AK::convert_between_host_and_big_endian(value.high().low()); | ||||
|     u64 d = AK::convert_between_host_and_big_endian(value.high().high()); | ||||
| 
 | ||||
|     ByteReader::store(data.offset_pointer(0 * sizeof(u64)), d); | ||||
|     ByteReader::store(data.offset_pointer(1 * sizeof(u64)), c); | ||||
|     ByteReader::store(data.offset_pointer(2 * sizeof(u64)), b); | ||||
|     ByteReader::store(data.offset_pointer(3 * sizeof(u64)), a); | ||||
|     ByteReader::store(data.offset_pointer(2 * sizeof(u64)), b); | ||||
|     ByteReader::store(data.offset_pointer(1 * sizeof(u64)), c); | ||||
|     ByteReader::store(data.offset_pointer(0 * sizeof(u64)), d); | ||||
| } | ||||
| 
 | ||||
| static u256 select(u256 const& left, u256 const& right, bool condition) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Daniel Bertalan
						Daniel Bertalan