[all-commits] [llvm/llvm-project] aaed27: [llvm][mustache] Fix UB in ASTNode::render()

Paul Kirth via All-commits all-commits at lists.llvm.org
Tue Jun 3 10:07:52 PDT 2025


  Branch: refs/heads/users/ilovepi/mustache-fix-ub
  Home:   https://github.com/llvm/llvm-project
  Commit: aaed271fc0012ddcc3b0f0afa10ed8a285d0bac0
      https://github.com/llvm/llvm-project/commit/aaed271fc0012ddcc3b0f0afa10ed8a285d0bac0
  Author: Paul Kirth <paulkirth at google.com>
  Date:   2025-06-03 (Tue, 03 Jun 2025)

  Changed paths:
    M llvm/lib/Support/Mustache.cpp

  Log Message:
  -----------
  [llvm][mustache] Fix UB in ASTNode::render()

The current implementation set a reference to a nullptr, leading to all
kinds of problems. Instead, we can check the various uses to ensure we
don't deref invalid memory, and improve the logic for how contexts are
passed to children, since that was also subtly wrong in some cases.


  Commit: 62f8d731c291e834ab2de67aade292e0c6473ed1
      https://github.com/llvm/llvm-project/commit/62f8d731c291e834ab2de67aade292e0c6473ed1
  Author: Paul Kirth <paulkirth at google.com>
  Date:   2025-06-03 (Tue, 03 Jun 2025)

  Changed paths:
    M llvm/lib/Support/Mustache.cpp

  Log Message:
  -----------
  Address comments

- fix includes
- avoid redundant conditional
- fix stale comment after rename.


Compare: https://github.com/llvm/llvm-project/compare/6a6884105656...62f8d731c291

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