Skip to content

Commit 27f3a97

Browse files
committed
Use a bitcast in Builder::ret to support non-native integers
1 parent a4fb579 commit 27f3a97

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,8 @@ impl<'a, 'gcc, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'gcc, 'tcx> {
540540
fn ret(&mut self, mut value: RValue<'gcc>) {
541541
let expected_return_type = self.current_func().get_return_type();
542542
if !expected_return_type.is_compatible_with(value.get_type()) {
543-
// NOTE: due to opaque pointers now being used, we need to cast here.
544-
value = self.context.new_cast(self.location, value, expected_return_type);
543+
// NOTE: due to opaque pointers now being used, we need to bitcast here.
544+
value = self.context.new_bitcast(self.location, value, expected_return_type);
545545
}
546546
self.llbb().end_with_return(self.location, value);
547547
}

0 commit comments

Comments
 (0)