Kotlin: Fixes

This commit is contained in:
Ian Lynagh
2021-08-12 13:23:01 +01:00
parent 3daec4376f
commit 4c8ff16552
5 changed files with 13 additions and 5 deletions

View File

@@ -258,7 +258,8 @@ class KotlinFileExtractor(val tw: TrapWriter) {
}
fun extractValueParameter(vp: IrValueParameter, parent: Label<out DbMethod>, idx: Int) {
val id = tw.getFreshIdLabel<DbParam>()
val label = "@\"params;{$parent};$idx\""
val id = tw.getLabelFor<DbParam>(label)
val typeId = useType(vp.type)
val locId = tw.getLocation(vp.startOffset, vp.endOffset)
tw.writeParams(id, typeId, idx, parent, id)

View File

@@ -0,0 +1,4 @@
name: codeql-java-consistency-queries
version: 0.0.0
libraryPathDependencies:
- codeql-java

View File

@@ -1,3 +1,5 @@
| exprs.kt:3:12:3:14 | 123 |
| exprs.kt:3:12:3:20 | ... + ... |
| exprs.kt:3:18:3:20 | 456 |
| exprs.kt:3:13:3:17 | ... + ... |
| exprs.kt:4:12:4:14 | 123 |
| exprs.kt:4:12:4:20 | ... + ... |
| exprs.kt:4:18:4:20 | 456 |
| file://:0:0:0:0 | i |

View File

@@ -1,5 +1,6 @@
fun topLevelMethod(x: Int, y: Int): Int {
var i = x + y
return 123 + 456
}

View File

@@ -4,7 +4,7 @@ package foo.bar
fun fooBarTopLevelMethod(x: Int, y: Int) {
}
class Class {
class Class2 {
fun fooBarClassMethod(x: Int, y: Int) {
}
}