Fix LGTM warnings in script_opt/CPP code

i.e. shadowed variables and "missing return values" (scare quotes)
This commit is contained in:
Jon Siwek 2021-05-06 12:06:57 -07:00
parent ac257e4a86
commit 1b825c51de
3 changed files with 18 additions and 11 deletions

View file

@ -620,11 +620,11 @@ string CPPCompile::GenRecordConstructorExpr(const Expr* e)
for ( auto i = 0; i < n; ++i )
{
const auto& e = exprs[i];
const auto& expr = exprs[i];
ASSERT(e->Tag() == EXPR_FIELD_ASSIGN);
ASSERT(expr->Tag() == EXPR_FIELD_ASSIGN);
vals += GenExpr(e->GetOp1(), GEN_VAL_PTR);
vals += GenExpr(expr->GetOp1(), GEN_VAL_PTR);
if ( i < n - 1 )
vals += ", ";
@ -668,12 +668,12 @@ string CPPCompile::GenTableConstructorExpr(const Expr* e)
for ( auto i = 0; i < n; ++i )
{
const auto& e = exprs[i];
const auto& expr = exprs[i];
ASSERT(e->Tag() == EXPR_ASSIGN);
ASSERT(expr->Tag() == EXPR_ASSIGN);
auto index = e->GetOp1();
auto v = e->GetOp2();
auto index = expr->GetOp1();
auto v = expr->GetOp2();
if ( index->Tag() == EXPR_LIST )
// Multiple indices.