tweak arraycopy model

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2936 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
sjfink 2008-07-01 01:52:34 +00:00
parent d79f973426
commit 80fcdc7bd5
2 changed files with 5 additions and 6 deletions

View File

@ -19,13 +19,10 @@ import com.ibm.wala.annotations.Internal;
public class System {
/**
* A simple model of object-array copy
* A simple model of object-array copy.
* This is not completely correct. TODO: fix it.
*/
static void arraycopy(Object src, Object dest) {
if (!src.getClass().isArray() || !dest.getClass().isArray()) {
return;
}
static void arraycopy(Object src, Object dest) {
if (src instanceof Object[]) {
Object[] A = (Object[]) src;
Object[] B = (Object[]) dest;
@ -71,6 +68,8 @@ public class System {
float[] B = (float[]) dest;
for (int i = 0; i < A.length; i++)
B[i] = A[i];
} else {
throw new ArrayStoreException();
}
}
}