target/riscv/program.c: fix clang warning

- I'm not sure I understand the logic behind the original statement,
but on macOS it fails to compile.
This commit is contained in:
Liviu Ionescu 2017-10-03 00:23:14 +03:00
parent 728a617bd4
commit f5a69e547f
1 changed files with 5 additions and 1 deletions

View File

@ -478,7 +478,11 @@ riscv_addr_t riscv_program_gah(struct riscv_program *p, riscv_addr_t addr)
riscv_addr_t riscv_program_gal(struct riscv_program *p, riscv_addr_t addr)
{
return ((addr > 0) ? 1 : 0) * (addr & 0x7FF);
if (addr > 0) {
return (addr & 0x7FF);
} else {
return 0;
}
}
int riscv_program_lah(struct riscv_program *p, enum gdb_regno d, riscv_addr_t addr)