fixed the invalid memory access issue in moo_compucharsucstr() and similar functions.

added the log.default_type_mask field 
restructured the builtin primitive function table
This commit is contained in:
hyunghwan.chung
2017-12-31 16:46:52 +00:00
parent c4daf616f0
commit 27dbedbc50
11 changed files with 255 additions and 286 deletions

View File

@ -8210,13 +8210,13 @@ static void fini_compiler (moo_t* moo)
}
}
int moo_compile (moo_t* moo, moo_ioimpl_t io)
static MOO_INLINE int _compile (moo_t* moo, moo_ioimpl_t io)
{
int n;
if (!io)
{
moo_seterrnum (moo, MOO_EINVAL);
moo_seterrbfmt (moo, MOO_EINVAL, "no IO implementation provided");
return -1;
}
@ -8297,6 +8297,19 @@ oops:
return -1;
}
int moo_compile (moo_t* moo, moo_ioimpl_t io)
{
int n;
int log_default_type_mask;
log_default_type_mask = moo->log.default_type_mask;
moo->log.default_type_mask |= MOO_LOG_COMPILER;
n = _compile (moo, io);
moo->log.default_type_mask = log_default_type_mask;
return n;
}
void moo_getsynerr (moo_t* moo, moo_synerr_t* synerr)
{
MOO_ASSERT (moo, moo->c != MOO_NULL);