Berry improve asserts and stack size

This commit is contained in:
Stephan Hadinger 2022-04-04 09:10:54 +02:00
parent e047c90228
commit 0915664eae
2 changed files with 12 additions and 1 deletions

View File

@ -251,6 +251,17 @@ extern "C" {
#ifdef USE_BERRY_DEBUG
#undef BE_DEBUG_RUNTIME_INFO
#define BE_DEBUG_RUNTIME_INFO 1 /* record line information in 32 bits to be places in IRAM */
#undef BE_DEBUG
#define BE_DEBUG 1
#undef be_assert
#define be_assert(expr) \
((expr) \
? (0) \
: serial_debug("BRY: ASSERT '%s', %s - %i\n", #expr, __FILE__, __LINE__))
#ifdef USE_LVGL
#undef BE_STACK_START
#define BE_STACK_START 200
#endif // USE_LVGL
#endif // USE_BERRY_DEBUG
#endif

View File

@ -1694,7 +1694,7 @@ static void statement(bparser *parser)
case OptSemic: scan_next_token(parser); break; /* empty statement */
default: expr_stmt(parser); break;
}
be_assert(parser->finfo->freereg == be_list_count(parser->finfo->local));
be_assert(parser->finfo->freereg >= be_list_count(parser->finfo->local));
}
static void stmtlist(bparser *parser)