Skip to content

Commit 332ad79

Browse files
committed
Allow not terminating finally blocks
1 parent bc0c991 commit 332ad79

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

gcc/jit/jit-playback.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -2307,14 +2307,14 @@ add_try_catch (location *loc,
23072307
}
23082308

23092309
tree try_body = alloc_stmt_list ();
2310-
int i;
2310+
unsigned int i;
23112311
tree stmt;
23122312
FOR_EACH_VEC_ELT (try_block->m_stmts, i, stmt) {
23132313
append_to_statement_list (stmt, &try_body);
23142314
}
23152315

23162316
tree catch_body = alloc_stmt_list ();
2317-
int j;
2317+
unsigned int j;
23182318
tree catch_stmt;
23192319
FOR_EACH_VEC_ELT (catch_block->m_stmts, j, catch_stmt) {
23202320
append_to_statement_list (catch_stmt, &catch_body);

gcc/jit/jit-recording.cc

+3
Original file line numberDiff line numberDiff line change
@@ -4645,6 +4645,9 @@ recording::block::add_try_catch (location *loc,
46454645
// TODO: explain why we set the blocks reachable state.
46464646
try_block->m_is_reachable = true;
46474647
catch_block->m_is_reachable = true;
4648+
/* The finally block can fallthrough, so we don't require the user to terminate it. */
4649+
if (is_finally)
4650+
catch_block->m_has_been_terminated = true;
46484651
m_ctxt->record (result);
46494652
m_statements.safe_push (result);
46504653
return result;

0 commit comments

Comments
 (0)