*fixed a crash bug when access an unnamed array.

This commit is contained in:
Wang Renxin 2017-10-29 16:27:27 +08:00
parent 0376dbcbca
commit 330e6a7f0f
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,6 @@
Oct. 29 2017
Fixed a crash bug when access an unnamed array
Oct. 25 2017 Oct. 25 2017
Fixed a memory leak with an unexpected value Fixed a memory leak with an unexpected value

View File

@ -9258,7 +9258,8 @@ static _array_t* _search_array_in_scope_chain(mb_interpreter_t* s, _array_t* i,
mb_assert(s && i); mb_assert(s && i);
result = i; result = i;
scp = _search_identifier_in_scope_chain(s, 0, result->name, _PATHING_NONE, 0, 0); if(result->name)
scp = _search_identifier_in_scope_chain(s, 0, result->name, _PATHING_NONE, 0, 0);
if(scp) { if(scp) {
obj = (_object_t*)scp->data; obj = (_object_t*)scp->data;
if(obj && obj->type == _DT_ARRAY) { if(obj && obj->type == _DT_ARRAY) {