pike.git/
src/
operators.c
Branch:
Tag:
Non-build tags
All tags
No tags
1996-03-24
1996-03-24 14:18:51 by Fredrik Hübinette (Hubbe) <hubbe@hubbe.net>
fb5c4fec1f415edf0cb4fd343e6134552b9d1038 (
29
lines) (+
15
/-
14
)
[
Show
|
Annotate
]
Branch:
fb5c4fec1f415edf0cb4fd343e6134552b9d1038
fixed small bug when garbage collecting
Rev: src/operators.c:1.6
382:
case T_STRING: { struct lpc_string *s,*ret;
-
sp--;
+
s=make_shared_string("");
-
ret=string_replace(sp[-
1
].u.string,sp[
0
].u.string,s);
+
ret=string_replace(sp[-
2
].u.string,sp[
-1
].u.string,s);
+
free_string(sp[-2].u.string);
free_string(sp[-1].u.string);
-
free_string(sp[0].u.string);
+
free_string(s);
-
sp[-
1
].u.string=ret;
+
sp[-
2
].u.string=ret;
+
sp--;
return; }
704:
case TWO_TYPES(T_ARRAY,T_STRING): { struct lpc_string *ret;
+
ret=implode(sp[-2].u.array,sp[-1].u.string);
+
free_string(sp[-1].u.string);
+
free_array(sp[-2].u.array);
+
sp[-2].type=T_STRING;
+
sp[-2].u.string=ret;
sp--;
-
ret=implode(sp[-1].u.array,sp[0].u.string);
-
free_string(sp[0].u.string);
-
free_array(sp[-1].u.array);
-
sp[-1].type=T_STRING;
-
sp[-1].u.string=ret;
+
return; }
779:
case T_STRING: { struct array *ret;
-
sp--;
-
ret=explode(sp[-
1
].u.string,sp[
0
].u.string);
+
ret=explode(sp[-
2
].u.string,sp[
-1
].u.string);
+
free_string(sp[-2].u.string);
free_string(sp[-1].u.string);
-
free_string(
sp[
0].u.string);
-
sp[
-
1
].type=T_ARRAY;
-
sp[-
1
].u.array=ret;
+
sp[-
2
].type=T_ARRAY;
+
sp[-
2
].u.array=ret;
+
sp--;
return; }