Skip to content

Commit ceb6439

Browse files
committed
Fix AIOOBE in LocalVariables.guessAllLocalVaraiblesUncached. Closes #2199
1 parent df97f78 commit ceb6439

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/main/kotlin/platform/mixin/util/LocalVariables.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,8 +229,11 @@ object LocalVariables {
229229
val extraVars = extraVariables[offset]
230230
if (extraVars != null) {
231231
for (variable in extraVars) {
232-
val localsHere = this.locals[offset]
232+
var localsHere = this.locals[offset]
233233
?: arrayOfNulls<SourceLocalVariable>(variable.index + 1).also { this.locals[offset] = it }
234+
if (variable.index >= localsHere.size) {
235+
localsHere = localsHere.copyOf(variable.index + 1)
236+
}
234237
localsHere[variable.index] = variable
235238
if (variable.type == PsiTypes.longType() || variable.type == PsiTypes.doubleType()) {
236239
if (variable.index + 1 < localsHere.size) {

0 commit comments

Comments
 (0)