Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ubsan] Add some handlers that do not yet exist and fix some format e…
…rrors Add handlers as below: 1. __ubsan_handle_function_type_mismatch 2. __ubsan_handle_alignment_assumption 3. __ubsan_handle_float_cast_overflow Also fix the format errors for compiling and printing. Test log is as below: start test_ubsan_function_type_mismatch ... ===================================UBSAN error=================================== ubsan: function type mismatch in lk/lib/test_ubsan/test_ubsan.c:191:5 Call function(0x12e8d) through pointer with incompatible type 'void (*)(void)' ================================================================================= start test_ubsan_alignment_assumption ... alignment assumption ===================================UBSAN error=================================== ubsan: Alignment Error in lk/lib/test_ubsan/test_ubsan.c:217:11 assumption of 32 byte alignment for pointer of type 'void *' failed address is 2 aligned, misalignment offset is 3 bytes ================================================================================= alignment assumption offset ===================================UBSAN error=================================== ubsan: Alignment Error in lk/lib/test_ubsan/test_ubsan.c:218:11 assumption of 32 byte alignment (with offset of 4 byte) for pointer of type 'void *' failed offset address is 2 aligned, misalignment offset is 31 bytes ================================================================================= start test_ubsan_float_cast_overflow ... ===================================UBSAN error=================================== ubsan: Float Cast Overflow in lk/lib/test_ubsan/test_ubsan.c:82:12 value 'double' is outside of the range of representable value of type 'unsigned int' at 0x2001d3e8 =================================================================================
- Loading branch information