Skip to content

Commit

Permalink
issue #35 update assertion check to ensure we accept an upvalue that …
Browse files Browse the repository at this point in the history
…refers to _ENV
  • Loading branch information
dibyendumajumdar committed Sep 30, 2020
1 parent 60ec292 commit 6f1b448
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ static struct lua_symbol *search_upvalue_in_function(struct ast_node *function,
{
switch (symbol->symbol_type) {
case SYM_UPVALUE: {
assert(symbol->upvalue.target_variable->symbol_type == SYM_LOCAL);
assert(symbol->upvalue.target_variable->symbol_type == SYM_LOCAL || symbol->upvalue.target_variable->symbol_type == SYM_ENV);
if (name == symbol->upvalue.target_variable->variable.var_name) {
return symbol;
}
Expand Down

0 comments on commit 6f1b448

Please sign in to comment.