fixed assertion expressions in run_switch()
This commit is contained in:
@ -2399,9 +2399,10 @@ static int run_switch (hawk_rtx_t* rtx, hawk_nde_switch_t* nde)
|
||||
int eval_true = 0;
|
||||
int ret = 0;
|
||||
|
||||
/* the test expression for the if statement cannot have
|
||||
/* the expression for the switch statement cannot have
|
||||
* chained expressions. this should not be allowed by the
|
||||
* parser first of all */
|
||||
HAWK_ASSERT(nde->type == HAWK_NDE_SWITCH);
|
||||
HAWK_ASSERT(nde->test->next == HAWK_NULL);
|
||||
|
||||
test = eval_expression(rtx, nde->test);
|
||||
@ -2409,9 +2410,10 @@ static int run_switch (hawk_rtx_t* rtx, hawk_nde_switch_t* nde)
|
||||
|
||||
hawk_rtx_refupval(rtx, test);
|
||||
|
||||
HAWK_ASSERT(nde->type == HAWK_NDE_CASE);
|
||||
case_part = (hawk_nde_case_t*)nde->case_part;
|
||||
default_part = (hawk_nde_case_t*)nde->default_part;
|
||||
HAWK_ASSERT(case_part->type == HAWK_NDE_CASE);
|
||||
HAWK_ASSERT(default_part->type == HAWK_NDE_CASE);
|
||||
|
||||
while (case_part)
|
||||
{
|
||||
|
Reference in New Issue
Block a user