test-char: fix undefined behavior
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 12 Mar 2019 13:06:04 +0000 (14:06 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 12 Mar 2019 14:18:40 +0000 (15:18 +0100)
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

index de328380c1f1b0928636c7d8eac186b564c863ca..95ccfd3cdb64889e0c91bd8d628573ba6288c7b6 100644 (file)
@@ -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;