[all-commits] [llvm/llvm-project] 2de1ac: [clang-doc] Avoid deref of invalid std::optional
Paul Kirth via All-commits
all-commits at lists.llvm.org
Wed Mar 19 08:27:14 PDT 2025
Branch: refs/heads/users/ilovepi/clang-doc-fix-optional
Home: https://github.com/llvm/llvm-project
Commit: 2de1ac2f0c759873a03850e054df490bbe48d7e6
https://github.com/llvm/llvm-project/commit/2de1ac2f0c759873a03850e054df490bbe48d7e6
Author: Paul Kirth <paulkirth at google.com>
Date: 2025-03-19 (Wed, 19 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