Skip to content

Commit 3d8bb37

Browse files
Rollup merge of rust-lang#154972 - chorman0773:return_address, r=Mark-Simulacrum
Implement `core::arch::return_address` and tests Tracking issue: rust-lang#154966 Implements libs-team#768
2 parents bff9870 + aaf8e61 commit 3d8bb37

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/intrinsics/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,6 +1523,12 @@ fn codegen_regular_intrinsic_call<'tcx>(
15231523
fx.bcx.set_cold_block(fx.bcx.current_block().unwrap());
15241524
}
15251525

1526+
sym::return_address => {
1527+
let val = fx.bcx.ins().get_return_address(fx.pointer_type);
1528+
let val = CValue::by_val(val, ret.layout());
1529+
ret.write_cvalue(fx, val);
1530+
}
1531+
15261532
// Unimplemented intrinsics must have a fallback body. The fallback body is obtained
15271533
// by converting the `InstanceKind::Intrinsic` to an `InstanceKind::Item`.
15281534
_ => {

0 commit comments

Comments
 (0)