fix mem error in for in range()

This commit is contained in:
lyon 2021-12-28 01:15:06 +08:00
parent dbc9b8e01c
commit a3465dbbeb
3 changed files with 9 additions and 11 deletions

View File

@ -4,10 +4,8 @@ import PikaStdData
import PikaMath
from PikaObj import *
list = PikaStdData.List()
i = 0
while i < 10:
list.append(i)
i = i + 1
for item in list:
print(item)
for i in range(0, 100):
print(i)
for i in range(0, 100):
print(i)

View File

@ -495,12 +495,12 @@ exit:
int32_t obj_removeArg(PikaObj* self, char* argPath) {
PikaObj* objHost = obj_getObj(self, argPath, 1);
PikaObj* obj = obj_getObj(self, argPath, 0);
Arg* obj_arg = obj_getArg(self, argPath);
Args* buffs = New_strBuff();
char* argName;
int32_t res;
if (NULL != obj) {
obj_deinit(obj);
if (TYPE_OBJECT == arg_getType(obj_arg)) {
obj_deinit(arg_getPtr(obj_arg));
}
int32_t err = 0;
if (NULL == objHost) {

View File

@ -116,7 +116,7 @@ static enum Instruct getInstruct(char* line) {
}
if (0 == strncmp(line + 2, "DEL", 3)) {
/* delete */
return EST;
return DEL;
}
if (0 == strncmp(line + 2, "EST", 3)) {
/* is exist */