Fix captured range bounds in launched for-loops
This commit is contained in:
1 parent
fbb1683ba3
commit
840cd32574
3 files changed
+47
-31
No files matched your search
@@ -7820,7 +7820,9 @@ class BytecodeCompiler(
|
||||
scopeSlotRefPosByKey[scopeKey] = ref.pos()
|
||||
}
|
||||
}
|
||||
return resolved
|
||||
if (resolved != null) return resolved
|
||||
localSlotIndexByName[ref.name]?.let { return scopeSlotCount + it }
|
||||
return null
|
||||
}
|
||||
|
||||
private fun resolveLocalSlotByRefOrName(ref: LocalSlotRef): Int? {
|
||||
@@ -8672,6 +8674,11 @@ class BytecodeCompiler(
|
||||
collectLoopVarNamesRef(ref.targetRef)
|
||||
collectLoopVarNamesRef(ref.indexRef)
|
||||
}
|
||||
is RangeRef -> {
|
||||
ref.left?.let { collectLoopVarNamesRef(it) }
|
||||
ref.right?.let { collectLoopVarNamesRef(it) }
|
||||
ref.step?.let { collectLoopVarNamesRef(it) }
|
||||
}
|
||||
else -> {}
|
||||
}
|
||||
}
|
||||
@@ -8798,6 +8805,11 @@ class BytecodeCompiler(
|
||||
collectScopeSlotsRef(ref.targetRef)
|
||||
collectScopeSlotsRef(ref.indexRef)
|
||||
}
|
||||
is RangeRef -> {
|
||||
ref.left?.let { collectScopeSlotsRef(it) }
|
||||
ref.right?.let { collectScopeSlotsRef(it) }
|
||||
ref.step?.let { collectScopeSlotsRef(it) }
|
||||
}
|
||||
is ClassOperatorRef -> {
|
||||
collectScopeSlotsRef(ref.target)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user