diff options
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/cmListFileCache.cxx | 1 | ||||
| -rw-r--r-- | Source/cmListFileCache.h | 8 |
2 files changed, 6 insertions, 3 deletions
diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index e465e1a..4d7e1e2 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -377,6 +377,7 @@ cmListFileBacktrace cmListFileBacktrace::Pop() const cmListFileContext const& cmListFileBacktrace::Top() const { assert(this->TopEntry); + assert(!this->TopEntry->IsBottom()); return this->TopEntry->Context; } diff --git a/Source/cmListFileCache.h b/Source/cmListFileCache.h index 2c91f7a..3d3afdf 100644 --- a/Source/cmListFileCache.h +++ b/Source/cmListFileCache.h @@ -124,9 +124,11 @@ public: // Backtraces may be copied, moved, and assigned as values. cmListFileBacktrace(cmListFileBacktrace const&) = default; - cmListFileBacktrace(cmListFileBacktrace&&) noexcept = default; + cmListFileBacktrace(cmListFileBacktrace&&) // NOLINT(clang-tidy) + noexcept = default; cmListFileBacktrace& operator=(cmListFileBacktrace const&) = default; - cmListFileBacktrace& operator=(cmListFileBacktrace&&) noexcept = default; + cmListFileBacktrace& operator=(cmListFileBacktrace&&) // NOLINT(clang-tidy) + noexcept = default; ~cmListFileBacktrace() = default; cmStateSnapshot GetBottom() const; @@ -144,7 +146,7 @@ public: cmListFileBacktrace Pop() const; // Get the context at the top of the backtrace. - // Returns an empty context if the backtrace is empty. + // This may be called only if Empty() would return false. cmListFileContext const& Top() const; // Print the top of the backtrace. |
