mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
target/arm: Fix temp double-free in sve ldr/str
The temp that gets assigned to clean_addr has been allocated with
new_tmp_a64, which means that it will be freed at the end of the
instruction. Freeing it earlier leads to assertion failure.
The loop creates a complication, in which we allocate a new local
temp, which does need freeing, and the final code path is shared
between the loop and non-loop.
Fix this complication by adding new_tmp_a64_local so that the new
local temp is freed at the end, and can be treated exactly like
the non-loop path.
Fixes: bba87d0a0f
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20200702175605.1987125-1-richard.henderson@linaro.org
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
parent
7fb3949d1f
commit
4b4dc9750a
3 changed files with 9 additions and 6 deletions
|
@ -461,6 +461,12 @@ TCGv_i64 new_tmp_a64(DisasContext *s)
|
|||
return s->tmp_a64[s->tmp_a64_count++] = tcg_temp_new_i64();
|
||||
}
|
||||
|
||||
TCGv_i64 new_tmp_a64_local(DisasContext *s)
|
||||
{
|
||||
assert(s->tmp_a64_count < TMP_A64_MAX);
|
||||
return s->tmp_a64[s->tmp_a64_count++] = tcg_temp_local_new_i64();
|
||||
}
|
||||
|
||||
TCGv_i64 new_tmp_a64_zero(DisasContext *s)
|
||||
{
|
||||
TCGv_i64 t = new_tmp_a64(s);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue