From 8730e3fb709883a0c31c10e6d27be25702d23cb1 Mon Sep 17 00:00:00 2001 From: Wang Renxin Date: Mon, 11 Jul 2016 14:24:29 +0800 Subject: [PATCH] *fixed a stack tracing issue. --- core/my_basic.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/core/my_basic.c b/core/my_basic.c index 8fb9660..0db6175 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -3627,7 +3627,13 @@ _array: } else { int calc_depth = running->calc_depth; running->calc_depth = _INFINITY_CALC_DEPTH; +#ifdef MB_ENABLE_STACK_TRACE + _ls_pushback(s->stack_frames, c->data.func->name); +#endif /* MB_ENABLE_STACK_TRACE */ result = (c->data.func->pointer)(s, (void**)&ast); +#ifdef MB_ENABLE_STACK_TRACE + _ls_popback(s->stack_frames); +#endif /* MB_ENABLE_STACK_TRACE */ running->calc_depth = calc_depth; } if(result != MB_FUNC_OK) { @@ -9726,13 +9732,17 @@ _retry: if(_is_binary(obj->data.func->pointer)) { _handle_error_on_obj(s, SE_RN_INVALID_EXPRESSION, s->source_file, DON(ast), MB_FUNC_ERR, _exit, result); } + if(_is_flow(obj->data.func->pointer)) { + result = (obj->data.func->pointer)(s, (void**)&ast); + } else { #ifdef MB_ENABLE_STACK_TRACE - _ls_pushback(s->stack_frames, obj->data.func->name); + _ls_pushback(s->stack_frames, obj->data.func->name); #endif /* MB_ENABLE_STACK_TRACE */ - result = (obj->data.func->pointer)(s, (void**)&ast); + result = (obj->data.func->pointer)(s, (void**)&ast); #ifdef MB_ENABLE_STACK_TRACE - _ls_popback(s->stack_frames); + _ls_popback(s->stack_frames); #endif /* MB_ENABLE_STACK_TRACE */ + } if(result == MB_FUNC_IGNORE) { result = MB_FUNC_OK; obj = (_object_t*)ast->data;