projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
flush
[m6w6/ext-psi]
/
src
/
libffi.c
diff --git
a/src/libffi.c
b/src/libffi.c
index bb1f34f7cd536ed9d72acb5afce08144191f3569..ee077af19b4b2af2cbba62b6c41dc2961355eaa8 100644
(file)
--- a/
src/libffi.c
+++ b/
src/libffi.c
@@
-152,7
+152,7
@@
static inline void PSI_LibffiCallInitClosure(PSI_Context *C, PSI_LibffiCall *cal
call->code);
#elif PSI_HAVE_FFI_PREP_CLOSURE
call->code);
#elif PSI_HAVE_FFI_PREP_CLOSURE
- rc = ffi_prep_closure(
data->code, &context->signature, psi_ffi_handler, data
);
+ rc = ffi_prep_closure(
call->code, &context->signature, psi_ffi_handler, impl
);
#else
# error "Neither ffi_prep_closure() nor ffi_prep_closure_loc() available"
#endif
#else
# error "Neither ffi_prep_closure() nor ffi_prep_closure_loc() available"
#endif
@@
-192,14
+192,17
@@
static void psi_ffi_init(PSI_Context *C)
C->context = PSI_LibffiContextInit(NULL);
}
C->context = PSI_LibffiContextInit(NULL);
}
-static void psi_ffi_dtor(PSI_Context *C) {
- size_t i;
+static void psi_ffi_dtor(PSI_Context *C)
+{
+ if (C->decls) {
+ size_t i;
- for (i = 0; i < C->decls->count; ++i) {
- decl *decl = C->decls->list[i];
+
for (i = 0; i < C->decls->count; ++i) {
+
decl *decl = C->decls->list[i];
- if (decl->call.info) {
- PSI_LibffiCallFree(decl->call.info);
+ if (decl->call.info) {
+ PSI_LibffiCallFree(decl->call.info);
+ }
}
}
free(C->context);
}
}
free(C->context);