This crash is observed in Polybench/linear-algebra/solvers/dynprog in llvm lnt. The crash seems to be because of invalid memory access.
Memory corruption occurs when we access elements of Result->DV[SJ - 1]. This is because the ConstrainedLevels is based on Max Nesting Level and DVEntry in Result is based on Common Nesting levels between the 2 memory instructions which are being analyzed.
Memory corruption occurs when MaxLevels>CommonLevels and we access Result->DV[SJ - 1] to update direction based on constraints.
This patch adds a check to avoid memory corruption and conservatively exits the loop updating the direction when the above mentioned scenario occurs.
Please let me know your inputs on this patch.
Thanks and Regards