Fix COPY adding elements

This commit is contained in:
otya128 committed 2016-12-19 23:15:29 +09:00
1 parent 2ac6efc1ed
commit 7cf62acc80
2 files changed
+48

No files matched your search

+12
View File
@@ -1994,6 +1994,18 @@ class BuiltinFunction
throw new TypeMismatch("COPY", sourceArrayIndex + 2);
len = args[sourceArrayIndex + 1].castInteger;
}
else
{
len = src.length - srcoffset;
}
if (dst.length < len + dstoffset)
{
if (dst.dimCount != 1)
{
throw new SubscriptOutOfRange("COPY");
}
dst.length = len + dstoffset;
}
if (src.type == ValueType.StringArray && dst.type == ValueType.StringArray)
{
for(int i = 0; i < len; i++)