diff options
| author | Antoni Boucher <bouanto@zoho.com> | 2024-04-19 20:57:40 -0400 |
|---|---|---|
| committer | Antoni Boucher <bouanto@zoho.com> | 2024-04-19 20:57:40 -0400 |
| commit | 9b628f8e82dfb02bf6870624eb4acdca7a20947e (patch) | |
| tree | f2ae8e3e6a55a16c9eb76578b26ea81c1f5e2e82 /src | |
| parent | ab7d138d1675939bd87ad9bd14bf1fc78d41edcd (diff) | |
| download | rust-9b628f8e82dfb02bf6870624eb4acdca7a20947e.tar.gz rust-9b628f8e82dfb02bf6870624eb4acdca7a20947e.zip | |
Fix panic when calling get_fn for a variable
Diffstat (limited to 'src')
| -rw-r--r-- | src/context.rs | 2 |
1 files changed, 2 insertions, 0 deletions
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 @@ 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) }; |
