Fix possible error in rare cases in LuaTable:

java.lang.ArrayIndexOutOfBoundsException: length=0; index=0
This commit is contained in:
Enyby
2019-12-29 16:46:58 +02:00
parent d6737c0bb3
commit 27edcc9a92

View File

@@ -720,7 +720,7 @@ public class LuaTable extends LuaValue implements Metatable {
StrongSlot entry = slot.first(); StrongSlot entry = slot.first();
if (entry != null) if (entry != null)
newArray[ k - 1 ] = entry.value(); newArray[ k - 1 ] = entry.value();
} else { } else if ( !(slot instanceof DeadSlot) ) {
int j = slot.keyindex( newHashMask ); int j = slot.keyindex( newHashMask );
newHash[j] = slot.relink( newHash[j] ); newHash[j] = slot.relink( newHash[j] );
} }