Skip to content

Commit

Permalink
resolve all the noreturn fn call
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Oct 10, 2024
1 parent 238ce63 commit 157310f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vlib/v/gen/c/cgen.v
Original file line number Diff line number Diff line change
Expand Up @@ -1926,7 +1926,7 @@ fn (mut g Gen) stmts_with_tmp_var(stmts []ast.Stmt, tmp_var string) bool {
g.fn_decl.return_type.clear_flag(.option)
}
styp = g.base_type(ret_typ)
if stmt.expr is ast.CallExpr && stmt.expr.name == 'panic' {
if stmt.expr is ast.CallExpr && stmt.expr.is_noreturn {
g.expr(stmt.expr)
g.writeln(';')
} else {
Expand Down Expand Up @@ -1963,7 +1963,7 @@ fn (mut g Gen) stmts_with_tmp_var(stmts []ast.Stmt, tmp_var string) bool {
} else {
ret_typ := g.fn_decl.return_type.clear_flag(.result)
styp = g.base_type(ret_typ)
if stmt.expr is ast.CallExpr && stmt.expr.name == 'panic' {
if stmt.expr is ast.CallExpr && stmt.expr.is_noreturn {
g.expr(stmt.expr)
g.writeln(';')
} else {
Expand Down

0 comments on commit 157310f

Please sign in to comment.