From 78762796e8ebc2f6a4b69b55c13ad59fb244c5df Mon Sep 17 00:00:00 2001 From: Abraham Gonzalez Date: Mon, 9 Feb 2026 15:59:51 -0800 Subject: [PATCH] Modify in_bits to check in_valid before accessing Signed-off-by: Abraham Gonzalez --- fesvr/tsi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fesvr/tsi.h b/fesvr/tsi.h index 825a3a00..fe60fcc3 100644 --- a/fesvr/tsi.h +++ b/fesvr/tsi.h @@ -26,8 +26,8 @@ class tsi_t : public htif_t uint32_t recv_word(); void switch_to_host(); - uint32_t in_bits() { return in_data.front(); } bool in_valid() { return !in_data.empty(); } + uint32_t in_bits() { return in_valid() ? in_data.front() : 0; } bool out_ready() { return true; } void tick(bool out_valid, uint32_t out_bits, bool in_ready);