not GC in 'for' loop

This commit is contained in:
lyon 2021-12-24 13:00:39 +08:00
parent d49d6c809a
commit 10662a9a90
14 changed files with 9 additions and 10 deletions

0
port/linux/api-make-linux.sh Normal file → Executable file
View File

0
port/linux/api-make-win10.sh Normal file → Executable file
View File

0
port/linux/api-make.sh Normal file → Executable file
View File

0
port/linux/gtest.sh Normal file → Executable file
View File

0
port/linux/init.sh Normal file → Executable file
View File

0
port/linux/make.sh Normal file → Executable file
View File

0
port/linux/package/pikascript/rust-msc-latest-linux Normal file → Executable file
View File

0
port/linux/pkg-push.sh Normal file → Executable file
View File

0
port/linux/pull-core.sh Normal file → Executable file
View File

0
port/linux/push-core.sh Normal file → Executable file
View File

0
port/linux/test-banchmark.sh Normal file → Executable file
View File

View File

@ -1400,8 +1400,6 @@ TEST(parser, for_list) {
"B0\n" "B0\n"
"0 JMP -1\n" "0 JMP -1\n"
"B0\n" "B0\n"
"0 PGC __list0\n"
"B0\n"
); );
stack_deinit(bs); stack_deinit(bs);
args_deinit(bf); args_deinit(bf);

0
port/linux/update-compiler.sh Normal file → Executable file
View File

View File

@ -1007,14 +1007,15 @@ char* AST_toPikaAsm(AST* ast, Args* buffs) {
if (strEqu(blockType, "for")) { if (strEqu(blockType, "for")) {
pikaAsm = ASM_addBlockDeepth(ast, buffs, pikaAsm, blockTypeNum); pikaAsm = ASM_addBlockDeepth(ast, buffs, pikaAsm, blockTypeNum);
pikaAsm = strsAppend(buffs, pikaAsm, (char*)"0 JMP -1\n"); pikaAsm = strsAppend(buffs, pikaAsm, (char*)"0 JMP -1\n");
pikaAsm = ASM_addBlockDeepth(ast, buffs, pikaAsm, blockTypeNum); /* garbage collect for the list */
char* __list_x = strsCopy(buffs, "__list"); // pikaAsm = ASM_addBlockDeepth(ast, buffs, pikaAsm, blockTypeNum);
char block_deepth_str[] = "0"; // char* __list_x = strsCopy(buffs, "__list");
block_deepth_str[0] += obj_getInt(ast, "blockDeepth"); // char block_deepth_str[] = "0";
__list_x = strsAppend(runBuffs, __list_x, block_deepth_str); // block_deepth_str[0] += obj_getInt(ast, "blockDeepth");
pikaAsm = strsAppend(buffs, pikaAsm, (char*)"0 PGC "); // __list_x = strsAppend(runBuffs, __list_x, block_deepth_str);
pikaAsm = strsAppend(buffs, pikaAsm, (char*)__list_x); // pikaAsm = strsAppend(buffs, pikaAsm, (char*)"0 PGC ");
pikaAsm = strsAppend(buffs, pikaAsm, (char*)"\n"); // pikaAsm = strsAppend(buffs, pikaAsm, (char*)__list_x);
// pikaAsm = strsAppend(buffs, pikaAsm, (char*)"\n");
} }
/* return when exit method */ /* return when exit method */
if (strEqu(blockType, "def")) { if (strEqu(blockType, "def")) {