Re: [PATCH] tcg/tci: fix logic error when registering helpers via FFI

2022-10-30 Thread Richard Henderson
On 10/29/22 11:44, Icenowy Zheng wrote: Ah I think this is a C99 feature. Is our C standard baseline high enough to use it? Yes, we use C2011. See the second line of meson.build: default_options: ... 'c_std=gnu11' r~

Re: [PATCH] tcg/tci: fix logic error when registering helpers via FFI

2022-10-30 Thread Peter Maydell
On Sat, 29 Oct 2022 at 01:45, Icenowy Zheng wrote: > > 在 2022-10-29星期六的 06:28 +1100,Richard Henderson写道: > > Oh my. I'm surprised any test cases at all worked. > > Queued to tcg-next, with the declaration of j moved to the loop > > itself: > > > > for (int j = 0; j < nargs; ++j) > > Ah I

Re: [PATCH] tcg/tci: fix logic error when registering helpers via FFI

2022-10-28 Thread Icenowy Zheng
在 2022-10-29星期六的 06:28 +1100,Richard Henderson写道: > On 10/28/22 18:21, Icenowy Zheng wrote: > > 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 helpe

Re: [PATCH] tcg/tci: fix logic error when registering helpers via FFI

2022-10-28 Thread Richard Henderson
On 10/28/22 18:21, Icenowy Zheng wrote: 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 usin

Re: [PATCH] tcg/tci: fix logic error when registering helpers via FFI

2022-10-28 Thread Philippe Mathieu-Daudé
On 28/10/22 09:21, Icenowy Zheng wrote: 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. Oops, I didn't notice while

Re: [PATCH] tcg/tci: fix logic error when registering helpers via FFI

2022-10-28 Thread Icenowy Zheng
在 2022-10-28星期五的 10:13 +0100,Alex Bennée写道: > > Icenowy Zheng writes: > > > 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 som

Re: [PATCH] tcg/tci: fix logic error when registering helpers via FFI

2022-10-28 Thread Alex Bennée
Icenowy Zheng writes: > 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 d

[PATCH] tcg/tci: fix logic error when registering helpers via FFI

2022-10-28 Thread Icenowy Zheng
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 i