*fixed a variable lookup issue with a ranged FOR loop.

This commit is contained in:
Wang Renxin 2017-11-17 19:01:00 +08:00
parent 9bf97114f7
commit 44e8466c44
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,6 @@
Nov. 17 2017
Fixed a variable lookup issue with a ranged FOR loop
Nov. 16 2017
Fixed a clearing issue of intermediate values in forked scope chain

View File

@ -11165,6 +11165,10 @@ static int _execute_ranged_for_loop(mb_interpreter_t* s, _ls_node_t** l, _var_t*
mb_assert(s && l && var_loop);
running = s->running_context;
#ifdef MB_ENABLE_CLASS
if(var_loop->pathing)
var_loop = _search_var_in_scope_chain(s, var_loop);
#endif /* MB_ENABLE_CLASS */
old_val = var_loop->data;
range_ptr = ⦥
_MAKE_NIL(range_ptr);