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 import PikaMath
from PikaObj import * from PikaObj import *
list = PikaStdData.List() for i in range(0, 100):
i = 0 print(i)
while i < 10:
list.append(i) for i in range(0, 100):
i = i + 1 print(i)
for item in list:
print(item)

View File

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

View File

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