Skip to content

Commit 9b628f8

Browse files
committed
Fix panic when calling get_fn for a variable
1 parent ab7d138 commit 9b628f8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/context.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,8 @@ impl<'gcc, 'tcx> MiscMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
432432

433433
let func = if self.intrinsics.borrow().contains_key(func_name) {
434434
self.intrinsics.borrow()[func_name]
435+
} else if let Some(variable) = self.get_declared_value(func_name) {
436+
return variable;
435437
} else {
436438
get_fn(self, instance)
437439
};

0 commit comments

Comments
 (0)