Skip to content

Commit ad1c76a

Browse files
Update codegen_lua.c
Ignorar quem não foi marcado.
1 parent acfa3c5 commit ad1c76a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/codegen_lua.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ static void emit_statement(FILE *out, const AstStmt *stmt, const FunctionTable *
163163
emit_block(out, &stmt->data.block, functions, signature, indent, 1);
164164
break;
165165
case STMT_DECL:
166+
if (!stmt->data.decl.is_used && !stmt->data.decl.is_array)
167+
{
168+
return; // Dead Code Elimination: Variável desaparece do Lua!
169+
}
170+
166171
if (stmt->data.decl.is_array)
167172
{
168173
emit_array_declaration(out, stmt, functions, indent);

0 commit comments

Comments
 (0)