Commit fe38154
Kotlin: include
For a call qualified through a not-null assertion (e.g. `s!!.foo()`),
`TrapWriter.getStartOffset` derives the call's start from its receiver.
Under K1 the receiver is the `CHECK_NOT_NULL`/EXCLEXCL intrinsic IrCall,
whose own `startOffset` points at the first `!` character rather than at
the operand `s`. The enclosing call therefore inherited the `!!` offset
and omitted the receiver operand from its span.
The `!!` intrinsic carries its operand as value argument 0 (not as a
dispatch/extension receiver), so the existing receiver-based adjustment
did not reach it. Extend `getStartOffset` to also consider value
argument 0 of an EXCLEXCL call, recursively. This makes a `!!`-qualified
call span from the operand, matching K2, which already anchors the
receiver at the operand.
The change affects source locations only; AST structure, call targets,
and dataflow relationships are unchanged. K2 output is unaffected because
its offsets already start at the operand. Fully converges
dataflow/notnullexpr and exprs/binop between the K1 and K2 suites and
removes 6 divergent rows overall.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 86bfc022-3ecc-4746-ba23-3b76c4e4c3e4!! operands in qualified-call locations under K11 parent 8d67df0 commit fe38154
4 files changed
Lines changed: 16 additions & 4 deletions
File tree
- java
- kotlin-extractor/src/main/kotlin
- ql/test-kotlin1/library-tests
- dataflow/notnullexpr
- exprs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
347 | 349 | | |
348 | 350 | | |
349 | 351 | | |
350 | | - | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
351 | 363 | | |
352 | 364 | | |
353 | 365 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1593 | 1593 | | |
1594 | 1594 | | |
1595 | 1595 | | |
1596 | | - | |
| 1596 | + | |
1597 | 1597 | | |
1598 | 1598 | | |
1599 | 1599 | | |
| |||
0 commit comments