From a9219bb31b5147dad1180713cea19a00c44a596c Mon Sep 17 00:00:00 2001 From: paladin-t Date: Thu, 17 Dec 2015 16:37:42 +0800 Subject: [PATCH] *fixed a multiple memory disposing bug. --- core/my_basic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/my_basic.c b/core/my_basic.c index bc430e6..da61fd8 100755 --- a/core/my_basic.c +++ b/core/my_basic.c @@ -11803,6 +11803,8 @@ int _std_print(mb_interpreter_t* s, void** l) { _MAKE_NIL(&tmp); _public_value_to_internal_object(&s->running_context->intermediate_value, &tmp); val_ptr = obj = &tmp; + if(tmp.type == _DT_STRING) + tmp.data.string = mb_memdup(tmp.data.string, (unsigned)(strlen(tmp.data.string) + 1)); if(ast) ast = ast->prev; } else if(obj->type == _DT_VAR) { val_ptr = obj = obj->data.variable->data;