JVM: fix SMAP range extension logic

If `mapLineNumber` was called in non-monotonic order, e.g. N then N+2
then N+1, the first two calls created a range that spans [N; N+2] but
the third call did not reuse it.
This commit is contained in:
pyos
2020-03-25 14:45:37 +01:00
committed by max-kammerer
parent b4d7dfd02c
commit 9d21800d8f
25 changed files with 284 additions and 108 deletions
@@ -2920,6 +2920,16 @@ public class IrJsCodegenInlineTestGenerated extends AbstractIrJsCodegenInlineTes
runTest("compiler/testData/codegen/boxInline/smap/oneFile.kt");
}
@TestMetadata("rangeFolding.kt")
public void testRangeFolding() throws Exception {
runTest("compiler/testData/codegen/boxInline/smap/rangeFolding.kt");
}
@TestMetadata("rangeFoldingInClass.kt")
public void testRangeFoldingInClass() throws Exception {
runTest("compiler/testData/codegen/boxInline/smap/rangeFoldingInClass.kt");
}
@TestMetadata("smap.kt")
public void testSmap() throws Exception {
runTest("compiler/testData/codegen/boxInline/smap/smap.kt");
@@ -2920,6 +2920,16 @@ public class JsCodegenInlineTestGenerated extends AbstractJsCodegenInlineTest {
runTest("compiler/testData/codegen/boxInline/smap/oneFile.kt");
}
@TestMetadata("rangeFolding.kt")
public void testRangeFolding() throws Exception {
runTest("compiler/testData/codegen/boxInline/smap/rangeFolding.kt");
}
@TestMetadata("rangeFoldingInClass.kt")
public void testRangeFoldingInClass() throws Exception {
runTest("compiler/testData/codegen/boxInline/smap/rangeFoldingInClass.kt");
}
@TestMetadata("smap.kt")
public void testSmap() throws Exception {
runTest("compiler/testData/codegen/boxInline/smap/smap.kt");