diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-08-05 23:11:33 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2020-08-06 18:30:44 +0200 |
| commit | f01f79df0512ef16dc1ae681edf75e6924a8cf2e (patch) | |
| tree | 8c72dd203e9ff624eeb2b9a69f7ac31676563b79 /validation/expand | |
| parent | a9e0d28f76699e6fc2c1795801cad75ece790841 (diff) | |
| download | sparse-dev-f01f79df0512ef16dc1ae681edf75e6924a8cf2e.tar.gz | |
shift-assign: fix linearization of shift-assign
The result of a shift-assigns has the same type as the left
operand but the shift itself must be done on the promoted type.
The usual conversions are not done for shifts.
The problem is that this promoted type is not stored explicitly
in the data structure. This is specific to shift-assigns because
for other operations, for example add-assign, the usual conversions
must be done and the resulting type can be found on the RHS.
Since at linearization, the LHS and the RHS must have the same type,
the solution is to cast the RHS to LHS's promoted type during
evaluation.
This solve a bunch of problems with shift-assigns, like doing
logical shift when an arithmetic shift was needed.
Fixes: efdefb100d086aaabf20d475c3d1a65cbceeb534
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation/expand')
0 files changed, 0 insertions, 0 deletions
