Skip to content

Instantly share code, notes, and snippets.

@pfpacket
Last active August 29, 2015 14:07
Show Gist options
  • Save pfpacket/b6317ba9637ff985d902 to your computer and use it in GitHub Desktop.
Save pfpacket/b6317ba9637ff985d902 to your computer and use it in GitHub Desktop.
listener_null_assertion.patch
From d4a15c626d0c9af03acee348be4051cab13ba2a8 Mon Sep 17 00:00:00 2001
From: Ryo Munakata <ryomnktml@gmail.com>
Date: Wed, 1 Oct 2014 20:20:17 +0900
Subject: [PATCH wayland] assert if a listener function is NULL
Signed-off-by: Ryo Munakata <ryomnktml@gmail.com>
---
src/connection.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/connection.c b/src/connection.c
index f292853..424edd4 100644
--- a/src/connection.c
+++ b/src/connection.c
@@ -931,6 +931,11 @@ wl_closure_invoke(struct wl_closure *closure, uint32_t flags,
count + 2, &ffi_type_void, ffi_types);
implementation = target->implementation;
+ if (!implementation[opcode]) {
+ wl_log("listener function for opcode %u of %s is NULL\n",
+ opcode, target->interface->name);
+ assert(implementation[opcode] != NULL);
+ }
ffi_call(&cif, implementation[opcode], NULL, ffi_args);
}
--
2.1.2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment