irrt: use __builtin_alloca

This commit is contained in:
Sebastien Bourdeauducq 2022-03-22 15:41:25 +08:00
parent 9d86b46e86
commit 718b076e50
2 changed files with 1 additions and 2 deletions

View File

@ -26,7 +26,6 @@ fn main() {
"-S", "-S",
"-Wall", "-Wall",
"-Wextra", "-Wextra",
"-Wno-implicit-function-declaration",
"-o", "-o",
"-", "-",
]; ];

View File

@ -104,7 +104,7 @@ int32_t __nac3_list_slice_assign_var_size(
|| MAX(src_start, src_end) < MIN(dest_start, dest_end) || MAX(src_start, src_end) < MIN(dest_start, dest_end)
); );
if (need_alloca) { if (need_alloca) {
uint8_t *tmp = alloca(src_arr_len * size); uint8_t *tmp = __builtin_alloca(src_arr_len * size);
__builtin_memcpy(tmp, src_arr, src_arr_len * size); __builtin_memcpy(tmp, src_arr, src_arr_len * size);
src_arr = tmp; src_arr = tmp;
} }