[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [csmith-dev] unsafe math



Hello

I know that the option CGOptions::avoid_signed_overflow(false) stop using the safe math functions. As far as I know it is true by default. I know there is no option to turn it off. But it seems to be a simple modification.

Just add some code like this in the RandomProgramGenerator.cpp and use --no-safe-math at command line.

        if (strcmp (argv[i], "--no-safe-math") == 0){
            CGOptions::avoid_signed_overflow(false);
            continue;
        }


I hope this helps.

Tomyo Maeshiro

On Fri, Aug 19, 2011 at 2:07 PM, John Regehr <regehr@cs.utah.edu> wrote:
Does Csmith have an option to just stop using the safe math functions, instead generating raw +, -, etc.?

I didn't see anything in the help output but thought I remembered that we used to be able to do this.

This would be a very nice thing to have when just trying to crash compilers.

Xuejun-- if this doesn't exist, I imagine you don't have time to do it. Can you tell me where to hack if I can make time over the weekend?

John