Fix bug where "a = new Array[3]" would produce an IndexOutOfBoundsException

git-svn-id: svn://10.0.0.236/trunk@83475 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nboyd%atg.com
2000-12-10 18:33:52 +00:00
parent 080e9c4096
commit de59febfdd
2 changed files with 12 additions and 6 deletions

View File

@@ -417,8 +417,7 @@ public class Interpreter extends LabelTable {
iCodeTop = addByte((byte)(itsLineNumber >> 8), iCodeTop);
iCodeTop = addByte((byte)(itsLineNumber & 0xff), iCodeTop);
iCodeTop = addString(itsSourceFile, iCodeTop);
}
else {
} else {
iCodeTop = addByte((byte) type, iCodeTop);
iCodeTop = addByte((byte)(nameIndex >> 8), iCodeTop);
iCodeTop = addByte((byte)(nameIndex & 0xFF), iCodeTop);
@@ -1727,7 +1726,11 @@ public class Interpreter extends LabelTable {
for (i = count - 1; i >= 0; i--)
outArgs[i] = stack[stackTop--];
lhs = stack[stackTop];
if (lhs == undefined) {
if (lhs == undefined &&
(iCode[pc+1] << 8) + (iCode[pc+2] & 0xFF) != -1)
{
// special code for better error message for call
// to undefined
lhs = getString(theData.itsStringTable, iCode,
pc + 1);
}

View File

@@ -417,8 +417,7 @@ public class Interpreter extends LabelTable {
iCodeTop = addByte((byte)(itsLineNumber >> 8), iCodeTop);
iCodeTop = addByte((byte)(itsLineNumber & 0xff), iCodeTop);
iCodeTop = addString(itsSourceFile, iCodeTop);
}
else {
} else {
iCodeTop = addByte((byte) type, iCodeTop);
iCodeTop = addByte((byte)(nameIndex >> 8), iCodeTop);
iCodeTop = addByte((byte)(nameIndex & 0xFF), iCodeTop);
@@ -1727,7 +1726,11 @@ public class Interpreter extends LabelTable {
for (i = count - 1; i >= 0; i--)
outArgs[i] = stack[stackTop--];
lhs = stack[stackTop];
if (lhs == undefined) {
if (lhs == undefined &&
(iCode[pc+1] << 8) + (iCode[pc+2] & 0xFF) != -1)
{
// special code for better error message for call
// to undefined
lhs = getString(theData.itsStringTable, iCode,
pc + 1);
}