@@ -831,6 +831,8 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
831
831
this ->visit_expr (*exprs[i]);
832
832
ASR::expr_t * expr = nullptr ;
833
833
ASR::call_arg_t arg;
834
+ arg.loc .first = -1 ;
835
+ arg.loc .last = -1 ;
834
836
if (tmp) {
835
837
expr = ASRUtils::EXPR (tmp);
836
838
arg.loc = expr->base .loc ;
@@ -2362,7 +2364,7 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
2362
2364
result = left_value >> right_value;
2363
2365
break ;
2364
2366
}
2365
- default : { LCOMPILERS_ASSERT ( false ); } // should never happen
2367
+ default : { throw SemanticError ( " ICE: Unknown binary operator " , loc ); } // should never happen
2366
2368
}
2367
2369
value = ASR::down_cast<ASR::expr_t >(ASR::make_IntegerConstant_t (
2368
2370
al, loc, result, dest_type));
@@ -3396,7 +3398,7 @@ class CommonVisitor : public AST::BaseVisitor<Struct> {
3396
3398
ASR::expr_t *left = ASRUtils::EXPR (tmp);
3397
3399
this ->visit_expr (*x.m_right );
3398
3400
ASR::expr_t *right = ASRUtils::EXPR (tmp);
3399
- ASR::binopType op;
3401
+ ASR::binopType op = ASR::binopType::Add /* temporary assignment */ ;
3400
3402
std::string op_name = " " ;
3401
3403
switch (x.m_op ) {
3402
3404
case (AST::operatorType::Add) : { op = ASR::binopType::Add; break ; }
@@ -5602,7 +5604,7 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
5602
5604
ASR::expr_t *right = ASRUtils::EXPR (tmp);
5603
5605
ASR::ttype_t * left_type = ASRUtils::expr_type (left);
5604
5606
ASR::ttype_t * right_type = ASRUtils::expr_type (right);
5605
- ASR::binopType op;
5607
+ ASR::binopType op = ASR::binopType::Add /* temporary assignment */ ;
5606
5608
std::string op_name = " " ;
5607
5609
switch (x.m_op ) {
5608
5610
case (AST::operatorType::Add) : { op = ASR::binopType::Add; break ; }
@@ -6313,7 +6315,9 @@ class BodyVisitor : public CommonVisitor<BodyVisitor> {
6313
6315
result = (strcmp < 0 || strcmp == 0 );
6314
6316
break ;
6315
6317
}
6316
- default : LCOMPILERS_ASSERT (false ); // should never happen
6318
+ default : {
6319
+ throw SemanticError (" ICE: Unknown compare operator" , x.base .base .loc ); // should never happen
6320
+ }
6317
6321
}
6318
6322
value = ASR::down_cast<ASR::expr_t >(ASR::make_LogicalConstant_t (
6319
6323
al, x.base .base .loc , result, type));
0 commit comments