summaryrefslogtreecommitdiffstats
path: root/tcg
diff options
context:
space:
mode:
authorIcenowy Zheng2022-10-28 21:23:44 +0200
committerRichard Henderson2022-10-31 21:28:53 +0100
commit9dd1d56e570e5119fef2b28fda811d6891e597a8 (patch)
treebe7a951f863d23cc20d5cd4fcf6d5b2f310925fc /tcg
parenttcg/sparc64: Remove sparc32plus constraints (diff)
downloadqemu-9dd1d56e570e5119fef2b28fda811d6891e597a8.tar.gz
qemu-9dd1d56e570e5119fef2b28fda811d6891e597a8.tar.xz
qemu-9dd1d56e570e5119fef2b28fda811d6891e597a8.zip
tcg/tci: fix logic error when registering helpers via FFI
When registering helpers via FFI for TCI, the inner loop that iterates parameters of the helper reuses (and thus pollutes) the same variable used by the outer loop that iterates all helpers, thus made some helpers unregistered. Fix this logic error by using a dedicated temporary variable for the inner loop. Fixes: 22f15579fa ("tcg: Build ffi data structures for helpers") Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Icenowy Zheng <uwu@icenowy.me> Message-Id: <20221028072145.1593205-1-uwu@icenowy.me> [rth: Move declaration of j to the for loop itself] Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'tcg')
-rw-r--r--tcg/tcg.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tcg/tcg.c b/tcg/tcg.c
index c9e664ee31..b6c46b7e25 100644
--- a/tcg/tcg.c
+++ b/tcg/tcg.c
@@ -634,9 +634,9 @@ static void tcg_context_init(unsigned max_cpus)
if (nargs != 0) {
ca->cif.arg_types = ca->args;
- for (i = 0; i < nargs; ++i) {
- int typecode = extract32(typemask, (i + 1) * 3, 3);
- ca->args[i] = typecode_to_ffi[typecode];
+ for (int j = 0; j < nargs; ++j) {
+ int typecode = extract32(typemask, (j + 1) * 3, 3);
+ ca->args[j] = typecode_to_ffi[typecode];
}
}