Skip to content

Commit

Permalink
Merge branch 'topic/165' into 'master'
Browse files Browse the repository at this point in the history
silent_exception_handlers: Fix handling of case statements.

See merge request eng/libadalang/langkit-query-language!141
  • Loading branch information
Roldak committed Nov 20, 2023
2 parents 15bd7c9 + e756bb4 commit e1cc9f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lkql_checker/share/lkql/control_flow.lkql
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fun all_branches(stmt) =
& [alt.f_stmts for alt in stmt.f_alternatives.children].to_list
& [stmt.f_else_stmts]
| CaseStmt =>
[alt.f_stmts for alt in stmt.f_alternatives]
[alt.f_stmts for alt in stmt.f_alternatives.children]
| BaseLoopStmt =>
# We cannot know for sure that control will go inside the loop, so
# return "null" as well.
Expand Down
9 changes: 7 additions & 2 deletions testsuite/tests/checks/silent_exception_handlers/exc.adb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,14 @@ exception
if I = 0 then
Log ("0");
elsif I = 1 then
Log ("other");
Log ("1");
else
raise;
case I is
when 2 =>
Log ("2");
when others =>
raise
end case;
end if;
when E : others => -- NOFLAG
I := 0;
Expand Down

0 comments on commit e1cc9f5

Please sign in to comment.