[all-commits] [llvm/llvm-project] b1653a: [clang-doc] Avoid deref of invalid std::optional
Paul Kirth via All-commits
all-commits at lists.llvm.org
Thu Mar 20 14:03:37 PDT 2025
Branch: refs/heads/users/ilovepi/clang-doc-fix-optional
Home: https://github.com/llvm/llvm-project
Commit: b1653a1167f9923d1266d2971773d585251109a1
https://github.com/llvm/llvm-project/commit/b1653a1167f9923d1266d2971773d585251109a1
Author: Paul Kirth <paulkirth at google.com>
Date: 2025-03-20 (Thu, 20 Mar 2025)
Changed paths:
M clang-tools-extra/clang-doc/HTMLGenerator.cpp
A clang-tools-extra/test/clang-doc/DR-131697.cpp
Log Message:
-----------
[clang-doc] Avoid deref of invalid std::optional
Since our existing guard is insufficient to prevent accessing the
std::optional when in an invalid state, guard the access with
`.value_or()`. This maintains the desired behavior, without running into
UB.
The new test should prevent regressions.
Fixes #131697
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