From: pcm <pcm...@us...> - 2005-07-29 21:02:35
|
Update of /cvsroot/javapathfinder/javapathfinder/src/gov/nasa/jpf/jvm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29252/src/gov/nasa/jpf/jvm Modified Files: ElementInfo.java Fields.java Log Message: fixes rather embarrasing index screwup in ElementInfo when accesing Long/Double array elements (the index in Fields is int[] based, so it has to be adjusted *2) Index: Fields.java =================================================================== RCS file: /cvsroot/javapathfinder/javapathfinder/src/gov/nasa/jpf/jvm/Fields.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- Fields.java 26 Apr 2005 19:44:00 -0000 1.1.1.1 +++ Fields.java 29 Jul 2005 21:02:26 -0000 1.2 @@ -129,7 +129,8 @@ } public void setLongValue (int index, long newValue) { - values[index++] = Types.hiLong(newValue); + int i = index; + values[index++] = Types.hiLong(newValue); values[index] = Types.loLong(newValue); } Index: ElementInfo.java =================================================================== RCS file: /cvsroot/javapathfinder/javapathfinder/src/gov/nasa/jpf/jvm/ElementInfo.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- ElementInfo.java 26 Apr 2005 19:44:00 -0000 1.1.1.1 +++ ElementInfo.java 29 Jul 2005 21:02:26 -0000 1.2 @@ -518,7 +518,7 @@ public void setLongElement(int index, long value) { checkArray(index); - cloneFields().setLongValue(index, value); + cloneFields().setLongValue(index*2, value); } public int getElement(int index) { @@ -528,7 +528,7 @@ public long getLongElement(int index) { checkArray(index); - return fields.getLongValue(index); + return fields.getLongValue(index*2); } public void setIndex(int newIndex) { |