summaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorMichael Jabbour <117195239+michael-jabbour-sonarsource@users.noreply.github.com>2025-05-27 10:37:52 +0200
committerGitHub <noreply@github.com>2025-05-27 09:37:52 +0100
commit8fe33a05b94d716830f7ad119d2afcb06e09cc4d (patch)
treefc41b05d0eae9782d0bd1ba097cd78bab8c060ec /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent052c70451afb7323ef72f321f3b0b5abb024b302 (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