Merge pull request #499 from rust-lang/fix/unreachable-in-get_fn

Fix panic when calling get_fn for a variable
This commit is contained in:
antoyo 2024-04-19 21:26:48 -04:00 committed by GitHub
commit 9941c3590d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -432,6 +432,8 @@ fn get_fn_addr(&self, instance: Instance<'tcx>) -> RValue<'gcc> {
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)
};