Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
12 years ago

If condition false, but statements inside the loop are still executed

Hello,

I have a C code written that uses kiss_fft (fast fourier transform). http://sourceforge.net/projects/kissfft/

The code runs just fine using Eclipse IDE. But when I run the same code using DS-5 (Cyclone 5 SoC), in one of the kiss fft function, the if statement is executed even though the condition is false. It is not supposed to. And then there is a segmentation fault (SIGSEV signal 11).

if (st->inverse)

phase *= -1;

From the attached images, st->inverse has the value 0. So the if condition is false and should not enter the loop but it does so regardless. I do not understand why. Anybody has had the same issue? or any suggestions?

Thanks.
No RepliesBe the first to reply