From b146131d18c1567acdc9bbba5acd73ade086ded8 Mon Sep 17 00:00:00 2001 From: Steve Reinhardt Date: Wed, 15 Apr 2009 23:12:00 -0700 Subject: [PATCH] o3: handle fetch with no active threads correctly. This situation can arise now on the first fetch cycle after the last active thread is halted. It seems easy enough to deal with when it happens rather than trying to avoid it. --- src/cpu/o3/fetch_impl.hh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh index fcee2daa6..c3be74234 100644 --- a/src/cpu/o3/fetch_impl.hh +++ b/src/cpu/o3/fetch_impl.hh @@ -1326,7 +1326,10 @@ DefaultFetch::getFetchingThread(FetchPriority &fetch_priority) } } else { std::list::iterator thread = activeThreads->begin(); - assert(thread != activeThreads->end()); + if (thread == activeThreads->end()) { + return -1; + } + int tid = *thread; if (fetchStatus[tid] == Running || -- 2.30.2