From cea7d9b227feb6a1d8d0d7ae2a49b7f291ec61d7 Mon Sep 17 00:00:00 2001 From: zhuoli72 Date: Sat, 30 Jul 2022 14:25:30 +0800 Subject: [PATCH] Fix local variable propagation to avoid false replacement of param variable Issue: I5JPW2 Signed-off-by: zhuoli72 Change-Id: Ic638f5fd13f8247b12bf75c05fffaceeb1cb3812 --- es2panda/binder/scope.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/es2panda/binder/scope.h b/es2panda/binder/scope.h index 7b95f5c062..2df4f08451 100644 --- a/es2panda/binder/scope.h +++ b/es2panda/binder/scope.h @@ -759,7 +759,9 @@ void Scope::PropagateBinding(ArenaAllocator *allocator, util::StringView name, A return; } - res->second->Reset(std::forward(args)...); + if (!res->second->Declaration()->IsParameterDecl()) { + res->second->Reset(std::forward(args)...); + } } } // namespace panda::es2panda::binder -- Gitee