Skip to content

Commit

Permalink
update some logic and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Jun 29, 2023
1 parent b29e612 commit 0308e02
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion crates/compiler/mono/src/inc_dec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1094,7 +1094,7 @@ fn insert_refcount_operations_binding<'a>(
}
}
Expr::Reset { .. } | Expr::ResetRef { .. } => {
unreachable!("Reset(ref) and reuse should not exist at this point")
unreachable!("Reset(ref) should not exist at this point")
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/compiler/mono/src/ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7583,7 +7583,7 @@ fn substitute_in_expr<'a>(
NullPointer => None,

Reset { .. } | ResetRef { .. } => {
unreachable!("reset/resetref/reuse have not been introduced yet")
unreachable!("reset(ref) has not been introduced yet")
}

Struct(args) => {
Expand Down
7 changes: 6 additions & 1 deletion crates/compiler/mono/src/tail_recursion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,12 @@ fn expr_contains_symbol(expr: &Expr, needle: Symbol) -> bool {
match expr {
Expr::Literal(_) => false,
Expr::Call(call) => call.arguments.contains(&needle),
Expr::Tag { arguments, .. } => arguments.contains(&needle),
Expr::Tag {
arguments, reuse, ..
} => match reuse {
None => arguments.contains(&needle),
Some(ru) => ru.symbol == needle || arguments.contains(&needle),
},
Expr::Struct(fields) => fields.contains(&needle),
Expr::NullPointer => false,
Expr::StructAtIndex { structure, .. }
Expand Down

0 comments on commit 0308e02

Please sign in to comment.