From 9b628f8e82dfb02bf6870624eb4acdca7a20947e Mon Sep 17 00:00:00 2001 From: Antoni Boucher Date: Fri, 19 Apr 2024 20:57:40 -0400 Subject: [PATCH] Fix panic when calling get_fn for a variable --- src/context.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/context.rs b/src/context.rs index 1b9cfd3652c..d04c7532b3c 100644 --- a/src/context.rs +++ b/src/context.rs @@ -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) };