Do not cache "last" value (i.e., size/length) in lowered for-loop
iteration over CharSequences. CharSequences may be mutable (e.g., StringBuilder) and therefore its contents and length can change within the loop.
This commit is contained in:
committed by
max-kammerer
parent
3da3e1cae9
commit
c16b59191b
+10
@@ -18819,6 +18819,16 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest {
|
||||
runTest("compiler/testData/codegen/box/ranges/forByteProgressionWithIntIncrement.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInCharSequenceLengthDecreasedInLoopBody.kt")
|
||||
public void testForInCharSequenceLengthDecreasedInLoopBody() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInCharSequenceLengthDecreasedInLoopBody.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInCharSequenceLengthIncreasedInLoopBody.kt")
|
||||
public void testForInCharSequenceLengthIncreasedInLoopBody() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInCharSequenceLengthIncreasedInLoopBody.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("forInRangeLiteralWithMixedTypeBounds.kt")
|
||||
public void testForInRangeLiteralWithMixedTypeBounds() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/ranges/forInRangeLiteralWithMixedTypeBounds.kt");
|
||||
|
||||
Reference in New Issue
Block a user