fix a bug of `string-copy!` with same dist and src
This commit is contained in:
parent
124ad994b2
commit
01b086fb61
|
@ -350,6 +350,9 @@ pic_str_string_copy_ip(pic_state *pic)
|
||||||
case 4:
|
case 4:
|
||||||
end = pic_strlen(from);
|
end = pic_strlen(from);
|
||||||
}
|
}
|
||||||
|
if (to == from) {
|
||||||
|
from = pic_substr(pic, from, 0, end);
|
||||||
|
}
|
||||||
|
|
||||||
while (start < end) {
|
while (start < end) {
|
||||||
pic_str_set(pic, to, at++, pic_str_ref(pic, from, start++));
|
pic_str_set(pic, to, at++, pic_str_ref(pic, from, start++));
|
||||||
|
|
Loading…
Reference in New Issue