Recovered from cvs revision 2007-11-01 14:01:00
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: func.c,v 1.13 2007/10/25 14:43:17 bacon Exp $
|
||||
* $Id: func.c,v 1.14 2007/10/31 13:56:54 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
@ -254,7 +254,7 @@ skip_close:
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __flush_extio (
|
||||
static int flush_extio (
|
||||
ase_awk_run_t* run, int extio, const ase_char_t* name, int n)
|
||||
{
|
||||
int n2;
|
||||
@ -337,15 +337,15 @@ static int bfn_fflush (
|
||||
}
|
||||
|
||||
/* flush the given extio */
|
||||
n = __flush_extio (
|
||||
n = flush_extio (
|
||||
run, ASE_AWK_EXTIO_FILE,
|
||||
((len0 == 0)? ASE_NULL: str0), 1);
|
||||
/*if (n == -99) return -1;*/
|
||||
n = __flush_extio (
|
||||
n = flush_extio (
|
||||
run, ASE_AWK_EXTIO_PIPE,
|
||||
((len0 == 0)? ASE_NULL: str0), n);
|
||||
/*if (n == -99) return -1;*/
|
||||
n = __flush_extio (
|
||||
n = flush_extio (
|
||||
run, ASE_AWK_EXTIO_COPROC,
|
||||
((len0 == 0)? ASE_NULL: str0), n);
|
||||
/*if (n == -99) return -1;*/
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: jni.c,v 1.42 2007/10/30 15:01:31 bacon Exp $
|
||||
* $Id: jni.c,v 1.43 2007/10/31 13:56:54 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
@ -1816,7 +1816,6 @@ static int handle_bfn (
|
||||
(*env)->CallVoidMethod (env, run_data->context_object, run_data->context_clear);
|
||||
if ((*env)->ExceptionCheck(env))
|
||||
{
|
||||
/* TODO #1: if exception is thrown in clear, it seems to end with a lot of memory leask. PLEASE CHECK THIS */
|
||||
if (is_debug(awk)) (*env)->ExceptionDescribe (env);
|
||||
(*env)->ExceptionClear (env);
|
||||
ase_awk_setrunerrnum (run, ASE_AWK_EBFNIMPL);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Id: run.c,v 1.20 2007/10/28 06:12:37 bacon Exp $
|
||||
* $Id: run.c,v 1.21 2007/10/31 13:56:54 bacon Exp $
|
||||
*
|
||||
* {License}
|
||||
*/
|
||||
@ -5502,13 +5502,25 @@ static ase_awk_val_t* eval_call (
|
||||
ase_dprintf (ASE_T("got return value\n"));
|
||||
#endif
|
||||
|
||||
/* this trick has been mentioned in run_return.
|
||||
* adjust the reference count of the return value.
|
||||
* the value must not be freed even if the reference count
|
||||
* is decremented to zero because its reference has been incremented
|
||||
* in run_return regardless of its reference count. */
|
||||
v = STACK_RETVAL(run);
|
||||
ase_awk_refdownval_nofree (run, v);
|
||||
if (n == -1)
|
||||
{
|
||||
/* if the earlier operations failed and this function
|
||||
* has to return a error, the return value is just
|
||||
* destroyed and replaced by nil */
|
||||
ase_awk_refdownval (run, v);
|
||||
STACK_RETVAL(run) = ase_awk_val_nil;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* this trick has been mentioned in run_return.
|
||||
* adjust the reference count of the return value.
|
||||
* the value must not be freed even if the reference count
|
||||
* reached zero because its reference has been incremented
|
||||
* in run_return or directly by ase_awk_setretval
|
||||
* regardless of its reference count. */
|
||||
ase_awk_refdownval_nofree (run, v);
|
||||
}
|
||||
|
||||
run->stack_top = (ase_size_t)run->stack[run->stack_base+1];
|
||||
run->stack_base = (ase_size_t)run->stack[run->stack_base+0];
|
||||
|
Reference in New Issue
Block a user