Kotlin: Mangle names of internal functions to match JVM symbols

This commit is contained in:
Chris Smowton
2022-06-30 21:46:55 +01:00
parent 83fd9c3b3e
commit dd93062101
16 changed files with 105 additions and 26 deletions

View File

@@ -0,0 +1,9 @@
public class User {
public static int test(Test1 test1, Test2 test2, Test3 test3) {
return test1.f$main() + test2.f$mymodule() + test3.f$reservedchars___();
}
}

View File

@@ -0,0 +1,4 @@
| User.java:3:21:3:24 | test |
| test1.kt:3:12:3:22 | f$main |
| test2.kt:3:12:3:22 | f$mymodule |
| test3.kt:3:12:3:22 | f$reservedchars___ |

View File

@@ -0,0 +1,3 @@
from create_database_utils import *
run_codeql_database_create(["kotlinc test1.kt", "kotlinc test2.kt -module-name mymodule", "kotlinc test3.kt -module-name reservedchars\\\"${}/", "javac User.java -cp ." ], lang="java")

View File

@@ -0,0 +1,5 @@
import java
from Method m
where m.fromSource()
select m

View File

@@ -0,0 +1,5 @@
public class Test1 {
internal fun f() = 1
}

View File

@@ -0,0 +1,5 @@
public class Test2 {
internal fun f() = 2
}

View File

@@ -0,0 +1,5 @@
public class Test3 {
internal fun f() = 3
}