diff options
| author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-09-24 10:08:52 +0300 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2019-09-30 03:39:05 +0200 |
| commit | 1a38b82ebc4f41d5cfb3ea69c0924bbb01ba1358 (patch) | |
| tree | 11c5606b71663a3b09b28de62a429d83bd8daa33 /validation | |
| parent | 959e165a34d52778ca96bb062dc9c30063e8ccdf (diff) | |
| download | sparse-dev-1a38b82ebc4f41d5cfb3ea69c0924bbb01ba1358.tar.gz | |
fix sign extension in casting enums
The function cast_value() needs the exact type of the old expression
but when called via cast_enum_list() this type is incorrect because:
- the same struct is used for the new and the old expression
- the type of the new expression is adjusted before cast_value()
is called.
Fix this by adjusting the type of the new expression only after
cast_value() has been called.
Fixes: 604a148a73af ("enum: fix cast_enum_list()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'validation')
| -rw-r--r-- | validation/enum-sign-extend.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/validation/enum-sign-extend.c b/validation/enum-sign-extend.c index 9dfbc5eb..d852c934 100644 --- a/validation/enum-sign-extend.c +++ b/validation/enum-sign-extend.c @@ -9,5 +9,4 @@ _Static_assert(b == -1L, "value"); /* * check-name: enum-sign-extend * check-command: sparse -m64 $file - * check-known-to-fail */ |
