Skip to content

Commit 7c71c83

Browse files
committed
Fix type_name intrinsic
1 parent 2e89179 commit 7c71c83

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/builder.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,13 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
11051105
// TODO(antoyo)
11061106
}
11071107

1108-
fn store(&mut self, val: RValue<'gcc>, ptr: RValue<'gcc>, align: Align) -> RValue<'gcc> {
1108+
fn store(&mut self, mut val: RValue<'gcc>, ptr: RValue<'gcc>, align: Align) -> RValue<'gcc> {
1109+
if self.structs_as_pointer.borrow().contains(&val) {
1110+
// NOTE: hack to workaround a limitation of the rustc API: see comment on
1111+
// CodegenCx.structs_as_pointer
1112+
val = val.dereference(self.location).to_rvalue();
1113+
}
1114+
11091115
self.store_with_flags(val, ptr, align, MemFlags::empty())
11101116
}
11111117

0 commit comments

Comments
 (0)