aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/linear/non-const-case.c
AgeCommit message (Collapse)AuthorFilesLines
2018-09-08fix linearization of non-constant switch-casesLuc Van Oostenryck1-1/+0
The linearization of switches & cases makes the assumption that the expressions for the cases are constants (EXPR_VALUE). So, the corresponding values are dereferenced without checks. However, if the code uses a non-constant case, this dereference produces a random value, probably one corresponding to some pointers belonging to the real type of the expression. Fix this by checking during linearization the constness of the expression and ignore the non-constant ones. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
2018-09-08add testcase for non-constant switch-caseLuc Van Oostenryck1-0/+38
Switches with non-constant cases are currently linearized using as value the bit pattern present in the expression, creating more or less random multijmps. Add a basic testcase to catch this. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>