Commit 94115ef
committed
Do not dereference a null callee in TBR analysis.
TBRAnalyzer::TraverseCallExpr read CE->getDirectCallee()->getNumParams()
unconditionally. An indirect call -- through a function pointer, or an
operator call whose operator has no resolvable FunctionDecl, as arises
inside Kokkos's mdspan-based View -- has no direct callee, so this
reads a null pointer. Guard the null case by conservatively marking
every argument as used and stopping.
No minimal standalone test accompanies this: the indirect calls clad can
otherwise differentiate (function and member-function pointers) are
unsupported and crash elsewhere, so a null direct callee only arises
through custom-derivative machinery such as the mdspan View. The path is
exercised by unittests/Kokkos/ViewAccess.1 parent 5538c90 commit 94115ef
1 file changed
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
411 | 421 | | |
412 | 422 | | |
413 | 423 | | |
| |||
0 commit comments