about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAntoni Boucher <bouanto@zoho.com>2025-06-28 14:44:54 -0400
committerAntoni Boucher <bouanto@zoho.com>2025-06-28 14:44:54 -0400
commit7c71c8388fbe1a06a160e43ff6a37e335cc8e00f (patch)
tree97239320cc4dcd5f8218f22e17f4825c027e3163
parent2e89179368b3c8fc46699b008a37e0ffafeac44b (diff)
downloadrust-7c71c8388fbe1a06a160e43ff6a37e335cc8e00f.tar.gz
rust-7c71c8388fbe1a06a160e43ff6a37e335cc8e00f.zip
Fix type_name intrinsic
-rw-r--r--src/builder.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/builder.rs b/src/builder.rs
index 96e3773c7c4..f995220f75d 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -1105,7 +1105,13 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
         // TODO(antoyo)
     }
 
-    fn store(&mut self, val: RValue<'gcc>, ptr: RValue<'gcc>, align: Align) -> RValue<'gcc> {
+    fn store(&mut self, mut val: RValue<'gcc>, ptr: RValue<'gcc>, align: Align) -> RValue<'gcc> {
+        if self.structs_as_pointer.borrow().contains(&val) {
+            // NOTE: hack to workaround a limitation of the rustc API: see comment on
+            // CodegenCx.structs_as_pointer
+            val = val.dereference(self.location).to_rvalue();
+        }
+
         self.store_with_flags(val, ptr, align, MemFlags::empty())
     }