[INTERPRETER]

* BUG: Make the interpreter compile correctly.
* BUG: Some fixes in callback management.


git-svn-id: svn://localhost/gambas/trunk@3039 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2010-07-14 01:57:13 +00:00
parent 3054690743
commit 2dda2135f8
2 changed files with 7 additions and 6 deletions

View file

@ -51,7 +51,6 @@ typedef
typedef
struct EXTERN_CALLBACK {
struct EXTERN_CALLBACK *next;
VALUE_FUNCTION func;
EXEC_GLOBAL exec;
void *closure;
int nparam;
@ -461,6 +460,8 @@ void EXTERN_exit(void)
cb = _callbacks;
_callbacks = cb->next;
if (cb->exec.object)
OBJECT_UNREF(cb->exec.object, "EXTERN_exit");
FREE(&cb->types, "EXTERN_exit");
FREE(&cb, "EXTERN_exit");
}
@ -474,7 +475,7 @@ static void callback(ffi_cif *cif, void *result, void **args, void *user_data)
};
EXTERN_CALLBACK *cb = (EXTERN_CALLBACK *)user_data;
VALUE_FUNCTION *value = &cb->func;
//VALUE_FUNCTION *value = &cb->func;
int i;
VALUE *arg;
@ -542,9 +543,10 @@ static void callback(ffi_cif *cif, void *result, void **args, void *user_data)
arg->type = T_NULL;
}
if (value->kind == FUNCTION_PUBLIC || value->kind == FUNCTION_PRIVATE)
{
EXEC = cb->exec;
if (!EXEC.native)
{
EXEC_function_keep();
// Do that later, within a TRY/CATCH: VALUE_conv(RP, cb->ret);
@ -655,7 +657,6 @@ void *EXTERN_make_callback(VALUE_FUNCTION *value)
cb->next = _callbacks;
_callbacks = cb;
cb->func = *value;
if (value->object)
OBJECT_REF(value->object, "EXTERN_make_callback");

View file

@ -138,7 +138,7 @@ void SUBR_strptr(ushort code)
}
else
{
len = SUBR_get_integer(&PARAM[1])
len = SUBR_get_integer(&PARAM[1]);
err = CHECK_address(ptr, len);
}