diff options
| author | Michael Jabbour <117195239+michael-jabbour-sonarsource@users.noreply.github.com> | 2025-05-27 10:37:52 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-05-27 09:37:52 +0100 |
| commit | 8fe33a05b94d716830f7ad119d2afcb06e09cc4d (patch) | |
| tree | fc41b05d0eae9782d0bd1ba097cd78bab8c060ec /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
| parent | 052c70451afb7323ef72f321f3b0b5abb024b302 (diff) | |
[NFC] Fix evaluation order dependency in call arguments (#141366)
The code in `ARMAsmParser::parseDirectiveReq` passes both
`parseRegister(Reg, SRegLoc, ERegLoc)` and `SRegLoc` as arguments to
`check()`. Since function arguments are indeterminately sequenced per
C++17 [expr.call]/5, a compiler can evaluate `SRegLoc` before
`parseRegister()` executes. This means `check()` receives a null
location instead of the actual parsed source location for error
reporting.
The fix separates the calls to establish explicit sequencing, ensuring
`check()` receives the correct source location.
This issue was detected by [the CFamily analyzer for
SonarQube](https://www.sonarsource.com/knowledge/languages/cpp/). I'm
happy to provide any additional information or clarification as needed.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions
