Commit 8fe33a0
authored
[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.1 parent 052c704 commit 8fe33a0
1 file changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11787 | 11787 | | |
11788 | 11788 | | |
11789 | 11789 | | |
11790 | | - | |
11791 | | - | |
11792 | | - | |
| 11790 | + | |
| 11791 | + | |
11793 | 11792 | | |
11794 | 11793 | | |
11795 | 11794 | | |
| |||
0 commit comments