c4-project / c4f

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

Loop surrounds should not surround breaks and continues #202

Closed MattWindsor91 closed 4 years ago

MattWindsor91 commented 4 years ago

Trying to fuzz a variant of fig1 from Morisset et al's PLDI13 paper where we substitute a break for the return NULL statement has revealed an interesting corner case not exercised by Memalloy-generated code: loop surround actions in live code can inadvertently wrap around break and continue statements, changing their semantics.

The fix here is conceptually straightforward: add path filters that forbid the construction of such surrounds.