*fixed an issue with reference count manipulation of a value.

This commit is contained in:
Wang Renxin 2017-02-28 19:31:53 +08:00
parent b575ff007b
commit 8cbdaa56f3
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,6 @@
Feb. 28 2017
Fixed an issue with reference count manipulation of a value
Feb. 25 2017 Feb. 25 2017
Added an MBIMPL macro Added an MBIMPL macro
Fixed some platform dependent macro issues for apple systems Fixed some platform dependent macro issues for apple systems

View File

@ -12508,7 +12508,7 @@ int mb_ref_value(struct mb_interpreter_t* s, void** l, mb_value_t val) {
int result = MB_FUNC_OK; int result = MB_FUNC_OK;
_object_t obj; _object_t obj;
if(!s || !l) { if(!s) {
result = MB_FUNC_ERR; result = MB_FUNC_ERR;
goto _exit; goto _exit;
@ -12526,6 +12526,7 @@ int mb_ref_value(struct mb_interpreter_t* s, void** l, mb_value_t val) {
#ifdef MB_ENABLE_CLASS #ifdef MB_ENABLE_CLASS
obj.type != _DT_CLASS && obj.type != _DT_CLASS &&
#endif /* MB_ENABLE_CLASS */ #endif /* MB_ENABLE_CLASS */
obj.type != _DT_ROUTINE &&
obj.type != _DT_ARRAY obj.type != _DT_ARRAY
) { ) {
_handle_error_on_obj(s, SE_RN_REFERENCED_TYPE_EXPECTED, s->source_file, DON2(l), MB_FUNC_ERR, _exit, result); _handle_error_on_obj(s, SE_RN_REFERENCED_TYPE_EXPECTED, s->source_file, DON2(l), MB_FUNC_ERR, _exit, result);
@ -12541,7 +12542,7 @@ int mb_unref_value(struct mb_interpreter_t* s, void** l, mb_value_t val) {
int result = MB_FUNC_OK; int result = MB_FUNC_OK;
_object_t obj; _object_t obj;
if(!s || !l) { if(!s) {
result = MB_FUNC_ERR; result = MB_FUNC_ERR;
goto _exit; goto _exit;
@ -12559,6 +12560,7 @@ int mb_unref_value(struct mb_interpreter_t* s, void** l, mb_value_t val) {
#ifdef MB_ENABLE_CLASS #ifdef MB_ENABLE_CLASS
obj.type != _DT_CLASS && obj.type != _DT_CLASS &&
#endif /* MB_ENABLE_CLASS */ #endif /* MB_ENABLE_CLASS */
obj.type != _DT_ROUTINE &&
obj.type != _DT_ARRAY obj.type != _DT_ARRAY
) { ) {
_handle_error_on_obj(s, SE_RN_REFERENCED_TYPE_EXPECTED, s->source_file, DON2(l), MB_FUNC_ERR, _exit, result); _handle_error_on_obj(s, SE_RN_REFERENCED_TYPE_EXPECTED, s->source_file, DON2(l), MB_FUNC_ERR, _exit, result);