Skip to content

Commit 4d4d153

Browse files
committed
#99 #100 *Fixed a crash bug of using stack after scope.
1 parent 8dbaa74 commit 4d4d153

File tree

2 files changed

+15
-9
lines changed

2 files changed

+15
-9
lines changed

HISTORY

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Apr. 29 2025
2+
Fixed a crash bug of using stack after scope, thanks to cde-
3+
Fixed a minus symbol parsing bug when MEM statement, thanks to Overscore
4+
15
Oct. 10 2023
26
Improved UTF8 input/output via console on Windows
37

core/my_basic.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**
44
** For the latest info, see https://github.com/paladin-t/my_basic/
55
**
6-
** Copyright (C) 2011 - 2024 Tony Wang
6+
** Copyright (C) 2011 - 2025 Tony Wang
77
**
88
** Permission is hereby granted, free of charge, to any person obtaining a copy of
99
** this software and associated documentation files (the "Software"), to deal in
@@ -3850,15 +3850,17 @@ static int _calc_expression(mb_interpreter_t* s, _ls_node_t** l, _object_t** val
38503850
if(ast)
38513851
ast = ast->prev;
38523852
if(bracket_count) {
3853-
_object_t _cb;
3854-
_func_t _cbf;
3855-
_MAKE_NIL(&_cb);
3856-
_cb.type = _DT_FUNC;
3857-
_cb.data.func = &_cbf;
3858-
_cb.data.func->name = ")";
3859-
_cb.data.func->pointer = _core_close_bracket;
3853+
_object_t* cb = _create_object();
3854+
_LAZY_INIT_GLIST;
3855+
_ls_pushback(garbage, cb);
3856+
_MAKE_NIL(cb);
3857+
cb->type = _DT_FUNC;
3858+
cb->data.func = (_func_t*)mb_malloc(sizeof(_func_t));
3859+
memset(cb->data.func, 0, sizeof(_func_t));
3860+
cb->data.func->name = mb_strdup(")", 2);
3861+
cb->data.func->pointer = _core_close_bracket;
38603862
while(bracket_count) {
3861-
_ls_pushback(optr, &_cb);
3863+
_ls_pushback(optr, cb);
38623864
bracket_count--;
38633865
f = 0;
38643866
}

0 commit comments

Comments
 (0)