mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 17:23:56 -06:00
tcg/tci: Move stack bounds check to compile-time
The existing check was incomplete: (1) Only applied to two of the 7 stores, and not to the loads at all. (2) Only checked the upper, but not the lower bound of the stack. Doing this at compile time means that we don't need to do it at runtime as well. Tested-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
90be4dde24
commit
53f405569c
2 changed files with 13 additions and 2 deletions
|
@ -628,7 +628,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env,
|
|||
t0 = tci_read_r32(regs, &tb_ptr);
|
||||
t1 = tci_read_r(regs, &tb_ptr);
|
||||
t2 = tci_read_s32(&tb_ptr);
|
||||
tci_assert(t1 != sp_value || (int32_t)t2 < 0);
|
||||
*(uint32_t *)(t1 + t2) = t0;
|
||||
break;
|
||||
|
||||
|
@ -884,7 +883,6 @@ uintptr_t QEMU_DISABLE_CFI tcg_qemu_tb_exec(CPUArchState *env,
|
|||
t0 = tci_read_r64(regs, &tb_ptr);
|
||||
t1 = tci_read_r(regs, &tb_ptr);
|
||||
t2 = tci_read_s32(&tb_ptr);
|
||||
tci_assert(t1 != sp_value || (int32_t)t2 < 0);
|
||||
*(uint64_t *)(t1 + t2) = t0;
|
||||
break;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue