aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/eval/assign-restricted-ok.c
AgeCommit message (Collapse)AuthorFilesLines
2021-02-24fix eval of the assignment of a non-restricted value to a restricted variableLuc Van Oostenryck1-0/+22
Assignment to restricted variables are severely ... restricted. Nevertheless, one value is always fine because it has always the same bit representation: 0. So, 0 is accepted unconditionally but this creates a problem because the type of this 0 needs to be adjusted. Otherwise 0 (int) is assigned as-is even on restricted variable with a different bit-length. Fix this by casting the value to the target type before accepting it. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>