Fixed an issue where the interrupt info list could underflow.
PiperOrigin-RevId: 707271098
Change-Id: I789de735db6b77947a7e63dcb94b8ee7a359e020
diff --git a/cheriot/cheriot_state.cc b/cheriot/cheriot_state.cc
index b1f5994..6a8c385 100644
--- a/cheriot/cheriot_state.cc
+++ b/cheriot/cheriot_state.cc
@@ -705,7 +705,7 @@
// This way any code that is triggered by the interrupt return counter will
// be able to access the interrupt info.
counter_interrupt_returns_.Increment(1);
- interrupt_info_list_.pop_back();
+ if (!interrupt_info_list_.empty()) interrupt_info_list_.pop_back();
}
// CheckForInterrupt is called whenever any relevant bits in the interrupt