c4-project / c4f

The C4 Concurrent C Fuzzer
MIT License
13 stars 1 forks source link

Add side-effectful expression generators #227

Open MattWindsor91 opened 3 years ago

MattWindsor91 commented 3 years ago

Per #226, there are situations where we want the expression generators to consider expressions that can modify variables. As well as that situation (dead paths of side-effecting expressions), this also includes anywhere within dead code, as well as (and this is probably more complex) variables where we don't actually care about the value.

Also per #226, I'm not entirely sure of the best way to do this without blowing up the expression generator, since side-effectful generators are just the usual type-safe generators but with more permissive nodes for things like atomic fetches. My first thought would be to functor-ise the main generators, but this is pretty heavyweight.

MattWindsor91 commented 3 years ago

When editing the above comment, I suddenly thought that one way of dealing with this might be having one generator, but marking variables that can be side-effected and/or being in a dead-code position (probably the latter) in the incoming variable environment. This gels well with a few environment changes I wanted to make a while ago, but got distracted from (and I can't remember quite what they were now!)