Skip to content

Commit

Permalink
Merge pull request #499 from rust-lang/fix/unreachable-in-get_fn
Browse files Browse the repository at this point in the history
Fix panic when calling get_fn for a variable
  • Loading branch information
antoyo authored Apr 20, 2024
2 parents e26e7ae + 9b628f8 commit 9941c35
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,8 @@ impl<'gcc, 'tcx> MiscMethods<'tcx> for CodegenCx<'gcc, 'tcx> {

let func = if self.intrinsics.borrow().contains_key(func_name) {
self.intrinsics.borrow()[func_name]
} else if let Some(variable) = self.get_declared_value(func_name) {
return variable;
} else {
get_fn(self, instance)
};
Expand Down

0 comments on commit 9941c35

Please sign in to comment.