Commit 651bde5f authored by John van Groningen's avatar John van Groningen
Browse files

bug fix, add checks for cases with no alternatives

parent 61393ec7
......@@ -4377,7 +4377,7 @@ static int generate_code_for_switch_node (NodeP node,int asp,int bsp,struct esc
first_arg=node->node_arguments;
match_b_stack_top_element=0;
if (first_arg->arg_node->node_kind==CaseNode && first_arg->arg_next!=NULL && first_arg->arg_next->arg_node->node_kind==CaseNode){
if (first_arg!=NULL && first_arg->arg_node->node_kind==CaseNode && first_arg->arg_next!=NULL && first_arg->arg_next->arg_node->node_kind==CaseNode){
if (node->node_state.state_type==SimpleState && (node->node_state.state_kind==OnA || node->node_state.state_kind==StrictOnA)){
int first_case_symbol_kind;
Symbol symbol;
......
......@@ -555,7 +555,7 @@ static int determine_failing_cases_and_adjust_ref_counts (NodeP node,NodeIdRefCo
/* to do: if non failing case for every constructor, default not reachable */
#if 1 /* added 8-4-1999 */
if (node->node_arguments->arg_next==NULL && node->node_arguments->arg_node->node_kind==CaseNode
if (node->node_arguments!=NULL && node->node_arguments->arg_next==NULL && node->node_arguments->arg_node->node_kind==CaseNode
&& (node->node_arguments->arg_node->node_symbol->symb_kind==tuple_symb
|| (node->node_arguments->arg_node->node_symbol->symb_kind==definition &&
node->node_arguments->arg_node->node_symbol->symb_def->sdef_kind==RECORDTYPE)))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment