[Qemu-devel] [PATCH 1/4] test-char: fix undefined behavior

Paolo Bonzini posted 3 patches 6 years, 11 months ago
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Thomas Huth <thuth@redhat.com>, Laurent Vivier <lvivier@redhat.com>, "Dr. David Alan Gilbert" <dgilbert@redhat.com>, Juan Quintela <quintela@redhat.com>
[Qemu-devel] [PATCH 1/4] test-char: fix undefined behavior
Posted by Paolo Bonzini 6 years, 11 months ago
Fixes the following failure with --enable-debug:

/tmp/qemu-test/src/tests/test-char.c:838:10: runtime error: load of value 40, which is not a valid value for type bool
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /tmp/qemu-test/src/tests/test-char.c:838:10 in

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 tests/test-char.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/test-char.c b/tests/test-char.c
index de328380c1..95ccfd3cdb 100644
--- a/tests/test-char.c
+++ b/tests/test-char.c
@@ -745,7 +745,7 @@ static void char_socket_server_test(gconstpointer opaque)
     Visitor *v;
     QemuThread thread;
     int ret;
-    bool reconnected;
+    bool reconnected = false;
     char *optstr;
     QemuOpts *opts;
 
-- 
2.20.1