mm/ubsan: fix build warning

ubsan/ubsan.c: In function ‘get_signed_val’:
ubsan/ubsan.c:162:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
  162 |       uint64_t ret = (uint64_t)val & mask;
      |

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an 2022-12-05 12:21:46 +08:00 committed by Xiang Xiao
parent 4592ce2f07
commit 415fa25eb7

View File

@ -159,7 +159,7 @@ static int64_t get_signed_val(FAR struct type_descriptor *type,
{
unsigned bits = type_bit_width(type);
uint64_t mask = (1llu << bits) - 1;
uint64_t ret = (uint64_t)val & mask;
uint64_t ret = (uintptr_t)val & mask;
return (int64_t)(((ret & (1llu << (bits - 1))) != 0) ?
ret | ~mask : ret);