mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-01 14:31:52 -06:00
tcg/sparc: Convert patch_reloc to return bool
Since 7ecd02a06f
, if patch_reloc fails we restart translation
with a smaller TB. SPARC had its function signature changed,
but not the logic. Replace assert with return false.
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
684db2a0b0
commit
6a6bfa3c60
1 changed files with 6 additions and 2 deletions
|
@ -323,12 +323,16 @@ static bool patch_reloc(tcg_insn_unit *src_rw, int type,
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case R_SPARC_WDISP16:
|
case R_SPARC_WDISP16:
|
||||||
assert(check_fit_ptr(pcrel >> 2, 16));
|
if (!check_fit_ptr(pcrel >> 2, 16)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
insn &= ~INSN_OFF16(-1);
|
insn &= ~INSN_OFF16(-1);
|
||||||
insn |= INSN_OFF16(pcrel);
|
insn |= INSN_OFF16(pcrel);
|
||||||
break;
|
break;
|
||||||
case R_SPARC_WDISP19:
|
case R_SPARC_WDISP19:
|
||||||
assert(check_fit_ptr(pcrel >> 2, 19));
|
if (!check_fit_ptr(pcrel >> 2, 19)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
insn &= ~INSN_OFF19(-1);
|
insn &= ~INSN_OFF19(-1);
|
||||||
insn |= INSN_OFF19(pcrel);
|
insn |= INSN_OFF19(pcrel);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue