Fix panic when calling get_fn for a variable

This commit is contained in:
Antoni Boucher 2024-04-19 20:57:40 -04:00
parent ab7d138d16
commit 9b628f8e82

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)
};