Skip to content

Commit

Permalink
Treat invariant(false, ...) as an exception
Browse files Browse the repository at this point in the history
  • Loading branch information
muglug committed Sep 26, 2024
1 parent c149c7a commit bd96959
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/analyzer/expr/call/function_call_analyzer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,11 @@ fn process_invariant(
statements_analyzer: &StatementsAnalyzer,
analysis_data: &mut FunctionAnalysisData,
) {
if first_arg.2 == aast::Expr_::False {
context.has_returned = true;
context.control_actions.insert(ControlAction::End);
return;
}
let assertion_context = statements_analyzer.get_assertion_context(
context.function_context.calling_class.as_ref(),
context.function_context.calling_functionlike_id.as_ref(),
Expand Down

0 comments on commit bd96959

Please sign in to comment.