Steps to reproduce:
create HQL query with 2 'in' clauses (like 'select from o where o.f in ( aram ) or o.f in ( aram1 )'
set 'param1' value to be large list (around 10k entries)
set 'param' value to be some non empty and non one element list
To reproduce the issue it is needed to ensure that values for 'param1' will be expanded first so that stack overflow will happen on next step during 'param' expansion.