From 7019aa96d82cdbb5ff6883fd05162aafc71a8ea8 Mon Sep 17 00:00:00 2001 From: Laurent THOMAS Date: Mon, 27 Dec 2021 11:09:21 +0100 Subject: [PATCH] workaround bug in set_ptrs_symb_idx() + log of the error --- openair1/PHY/NR_REFSIG/ptrs_nr.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/openair1/PHY/NR_REFSIG/ptrs_nr.c b/openair1/PHY/NR_REFSIG/ptrs_nr.c index b50c9a7bc9..dec5bfc4f9 100644 --- a/openair1/PHY/NR_REFSIG/ptrs_nr.c +++ b/openair1/PHY/NR_REFSIG/ptrs_nr.c @@ -105,14 +105,18 @@ void set_ptrs_symb_idx(uint16_t *ptrs_symbols, uint8_t L_ptrs, uint16_t ul_dmrs_symb_pos) { - uint8_t i = 0, last_symbol, is_dmrs_symbol, l_ref; - int8_t l_counter; + uint i = 0, last_symbol, l_ref; + int l_counter; l_ref = start_symbol; last_symbol = start_symbol + duration_in_symbols - 1; + if (L_ptrs==0) { + LOG_E(PHY,"bug: impossible L_ptrs\n"); + return; + } while ( (l_ref + i*L_ptrs) <= last_symbol) { - is_dmrs_symbol = 0; + int is_dmrs_symbol = 0; for(l_counter = l_ref + i*L_ptrs; l_counter >= max(l_ref + (i-1)*L_ptrs + 1, l_ref); l_counter--) {