Commit 6d9be436 authored by TYAGIRIS's avatar TYAGIRIS
Browse files

usan fixes in lc3plus

parent fa73f996
Loading
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -705,7 +705,11 @@ void ac_shift_fl(Encoder_State_fl* st)
        st->carry_count = st->carry_count + 1;
    }

#ifdef FIX_1288_SPLIT_REND_XSAN
	st->low = (LC3_INT)((LC3_UINT32)st->low << 8);
#else
    st->low = st->low << 8;
#endif
    st->low = (st->low) & (16777215); /* 2^24 - 1 */
}

+8 −0
Original line number Diff line number Diff line
@@ -88,9 +88,17 @@ static int null_in_list(void **list, int n)
/* return pointer to aligned base + base_size, *base_size += size + 4 bytes align */
void *balloc(void *base, size_t *base_size, size_t size)
{
#ifdef FIX_1288_SPLIT_REND_XSAN
	uintptr_t ptr = ((uintptr_t)base + *base_size + 3) & (uintptr_t)(~3);
#else
    uintptr_t ptr = ((uintptr_t)base + *base_size + 3) & ~3;
#endif
    assert((uintptr_t)base % 4 == 0); /* base must be 4-byte aligned */
#ifdef FIX_1288_SPLIT_REND_XSAN
	*base_size = (*base_size + size + 3) & (uintptr_t)(~3);
#else
    *base_size = (*base_size + size + 3) & ~3;
#endif
    return (void *)ptr;
}