[Tarantool-patches] [PATCH luajit 18/19] DynASM/MIPS: Fix shadowed variable.

Sergey Bronnikov sergeyb at tarantool.org
Thu Aug 17 15:01:56 MSK 2023


Hi, Sergey


thanks for the patch! LGTM


(to be honestly I'm a bit confused why a single warning was fixed,

when luacheck reports about 112 warnings in dynasm/ directory. But this 
question is out of scope of backporting.).


Sergey

On 8/9/23 18:36, Sergey Kaplun wrote:
> From: Mike Pall <mike>
>
> Cleanup only, bug cannot trigger.
> Thanks to Domingo Alvarez Duarte.
>
> (cherry-picked from commit 5c911998a3c85d024a8006feafc68d0b4c962fd8)
>
> This patch fixes local shadow variable `n` in `template__` function from
> <dynasm/dasm_mips.lua> by renaming it to `m`. Since this cannot be
> triggered, there is no test provided.
>
> Sergey Kaplun:
> * added the description for the problem
> ---
>   dynasm/dasm_mips.lua | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/dynasm/dasm_mips.lua b/dynasm/dasm_mips.lua
> index 78a4e34a..bd2a2b43 100644
> --- a/dynasm/dasm_mips.lua
> +++ b/dynasm/dasm_mips.lua
> @@ -809,9 +809,9 @@ map_op[".template__"] = function(params, template, nparams)
>       elseif p == "X" then
>         op = op + parse_index(params[n]); n = n + 1
>       elseif p == "B" or p == "J" then
> -      local mode, n, s = parse_label(params[n], false)
> -      if p == "B" then n = n + 2048 end
> -      waction("REL_"..mode, n, s, 1)
> +      local mode, m, s = parse_label(params[n], false)
> +      if p == "B" then m = m + 2048 end
> +      waction("REL_"..mode, m, s, 1)
>         n = n + 1
>       elseif p == "A" then
>         op = op + parse_imm(params[n], 5, 6, 0, false); n = n + 1


More information about the Tarantool-patches mailing list