[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 07/13] win32: avoid discarding the exception handler
|
From: |
marcandre . lureau |
|
Subject: |
[PULL 07/13] win32: avoid discarding the exception handler |
|
Date: |
Tue, 3 Oct 2023 16:35:36 +0400 |
From: Marc-André Lureau <marcandre.lureau@redhat.com>
In all likelihood, the compiler with lto doesn't see the function being
used, from assembly macro __try1. Help it by marking the function has
being used.
Resolves:
https://gitlab.com/qemu-project/qemu/-/issues/1904
Fixes: commit d89f30b4df ("win32: wrap socket close() with an exception
handler")
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
include/qemu/compiler.h | 6 ++++++
util/oslib-win32.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/include/qemu/compiler.h b/include/qemu/compiler.h
index 7f1bbbf05f..1109482a00 100644
--- a/include/qemu/compiler.h
+++ b/include/qemu/compiler.h
@@ -206,4 +206,10 @@
#define QEMU_ANNOTATE(x)
#endif
+#if __has_attribute(used)
+# define QEMU_USED __attribute__((used))
+#else
+# define QEMU_USED
+#endif
+
#endif /* COMPILER_H */
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index 19a0ea7fbe..55b0189dc3 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -479,7 +479,7 @@ int qemu_bind_wrap(int sockfd, const struct sockaddr *addr,
return ret;
}
-EXCEPTION_DISPOSITION
+QEMU_USED EXCEPTION_DISPOSITION
win32_close_exception_handler(struct _EXCEPTION_RECORD *exception_record,
void *registration, struct _CONTEXT *context,
void *dispatcher)
--
2.41.0
- [PULL 00/13] Misc patches, marcandre . lureau, 2023/10/03
- [PULL 01/13] input: Allow to choose console with qemu_input_is_absolute, marcandre . lureau, 2023/10/03
- [PULL 02/13] ui/console: make qemu_console_is_multihead() static, marcandre . lureau, 2023/10/03
- [PULL 04/13] ui/console: eliminate QOM properties from qemu_console_is_multihead(), marcandre . lureau, 2023/10/03
- [PULL 03/13] ui/console: only walk QemuGraphicConsoles in qemu_console_is_multihead(), marcandre . lureau, 2023/10/03
- [PULL 05/13] ui/console: sanitize search in qemu_graphic_console_is_multihead(), marcandre . lureau, 2023/10/03
- [PULL 07/13] win32: avoid discarding the exception handler,
marcandre . lureau <=
- [PULL 06/13] ui: add XBGR8888 and ABGR8888 in drm_format_pixman_map, marcandre . lureau, 2023/10/03
- [PULL 08/13] ui/gtk: fix UI info precondition, marcandre . lureau, 2023/10/03
- [PULL 09/13] analyze-migration: ignore RAM_SAVE_FLAG_MULTIFD_FLUSH, marcandre . lureau, 2023/10/03
- [PULL 10/13] hw/core: remove needless includes, marcandre . lureau, 2023/10/03
- [PULL 13/13] chardev/char-pty: Avoid losing bytes when the other side just (re-)connected, marcandre . lureau, 2023/10/03
- [PULL 11/13] hw/pc: remove needless includes, marcandre . lureau, 2023/10/03
- [PULL 12/13] hw/display/ramfb: plug slight guest-triggerable leak on mode setting, marcandre . lureau, 2023/10/03
- Re: [PULL 00/13] Misc patches, Stefan Hajnoczi, 2023/10/05