connection: Make sure we can invoke closures built with wl_closure_vmarshal()

This commit is contained in:
Kristian Høgsberg 2012-04-22 14:16:08 -04:00
parent 1901d66ffc
commit 243672cd3c

View File

@ -422,6 +422,9 @@ wl_closure_vmarshal(struct wl_closure *closure,
end = &closure->buffer[ARRAY_LENGTH(closure->buffer)]; end = &closure->buffer[ARRAY_LENGTH(closure->buffer)];
p = &start[2]; p = &start[2];
closure->types[0] = &ffi_type_pointer;
closure->types[1] = &ffi_type_pointer;
for (i = 2; i < count; i++) { for (i = 2; i < count; i++) {
switch (message->signature[i - 2]) { switch (message->signature[i - 2]) {
case 'u': case 'u':
@ -538,6 +541,9 @@ wl_closure_vmarshal(struct wl_closure *closure,
closure->message = message; closure->message = message;
closure->count = count; closure->count = count;
ffi_prep_cif(&closure->cif, FFI_DEFAULT_ABI,
closure->count, &ffi_type_void, closure->types);
return 0; return 0;
err: err:
@ -723,6 +729,7 @@ wl_connection_demarshal(struct wl_connection *connection,
} }
closure->count = i; closure->count = i;
ffi_prep_cif(&closure->cif, FFI_DEFAULT_ABI, ffi_prep_cif(&closure->cif, FFI_DEFAULT_ABI,
closure->count, &ffi_type_void, closure->types); closure->count, &ffi_type_void, closure->types);