[all-commits] [llvm/llvm-project] 8fe33a: [NFC] Fix evaluation order dependency in call argu...

Michael Jabbour via All-commits all-commits at lists.llvm.org
Tue May 27 01:38:13 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8fe33a05b94d716830f7ad119d2afcb06e09cc4d
      https://github.com/llvm/llvm-project/commit/8fe33a05b94d716830f7ad119d2afcb06e09cc4d
  Author: Michael Jabbour <117195239+michael-jabbour-sonarsource at users.noreply.github.com>
  Date:   2025-05-27 (Tue, 27 May 2025)

  Changed paths:
    M llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list