mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
cmListFileCache: Add missing assertion in backtrace Top method
We can only get the top of a stack that has at least one call. Update the method's comment accordingly.
This commit is contained in:
@@ -377,6 +377,7 @@ cmListFileBacktrace cmListFileBacktrace::Pop() const
|
||||
cmListFileContext const& cmListFileBacktrace::Top() const
|
||||
{
|
||||
assert(this->TopEntry);
|
||||
assert(!this->TopEntry->IsBottom());
|
||||
return this->TopEntry->Context;
|
||||
}
|
||||
|
||||
|
||||
@@ -144,7 +144,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.
|
||||
|
||||
Reference in New Issue
Block a user