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

Sergey Kaplun skaplun at tarantool.org
Wed Aug 9 18:36:07 MSK 2023


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
-- 
2.41.0



More information about the Tarantool-patches mailing list