diff options
| author | Peter Maydell | 2014-12-23 23:26:55 +0100 |
|---|---|---|
| committer | Michael Tokarev | 2015-01-15 08:44:13 +0100 |
| commit | 90d6a6730b4dbe7d0ada9900aba8263d61376812 (patch) | |
| tree | 99985a5fd6182dc2a5a36ed388f30db6b7fd1b94 /migration | |
| parent | translate-all: Mark map_exec() with the 'unused' attribute (diff) | |
| download | qemu-90d6a6730b4dbe7d0ada9900aba8263d61376812.tar.gz qemu-90d6a6730b4dbe7d0ada9900aba8263d61376812.tar.xz qemu-90d6a6730b4dbe7d0ada9900aba8263d61376812.zip | |
migration/qemu-file.c: Don't shift left into sign bit
Add a cast in qemu_get_be32() to avoid shifting left into the sign
bit of a signed integer (which is undefined behaviour in C).
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'migration')
| -rw-r--r-- | migration/qemu-file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/migration/qemu-file.c b/migration/qemu-file.c index d2d40073f0..a7f2a34430 100644 --- a/migration/qemu-file.c +++ b/migration/qemu-file.c @@ -503,7 +503,7 @@ unsigned int qemu_get_be16(QEMUFile *f) unsigned int qemu_get_be32(QEMUFile *f) { unsigned int v; - v = qemu_get_byte(f) << 24; + v = (unsigned int)qemu_get_byte(f) << 24; v |= qemu_get_byte(f) << 16; v |= qemu_get_byte(f) << 8; v |= qemu_get_byte(f); |
