File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change 52
52
// Our goal here is to touch each page between %rsp+8 and %rsp+8-%rax,
53
53
// ensuring that if any pages are unmapped we'll make a page fault.
54
54
//
55
+ // This function is unsafe because it uses a custom ABI, it does not actually match `extern "C"`.
56
+ //
55
57
// The ABI here is that the stack frame size is located in `%rax`. Upon
56
58
// return we're not supposed to modify `%rsp` or `%rax`.
57
59
#[ cfg( target_arch = "x86_64" ) ]
@@ -141,6 +143,8 @@ pub unsafe extern "C" fn __rust_probestack() {
141
143
// that on Unix we're expected to restore everything as it was, this
142
144
// function basically can't tamper with anything.
143
145
//
146
+ // This function is unsafe because it uses a custom ABI, it does not actually match `extern "C"`.
147
+ //
144
148
// The ABI here is the same as x86_64, except everything is 32-bits large.
145
149
#[ unsafe( naked) ]
146
150
#[ no_mangle]
@@ -186,6 +190,8 @@ pub unsafe extern "C" fn __rust_probestack() {
186
190
// probestack function will also do things like _chkstk in MSVC.
187
191
// So we need to sub %ax %sp in probestack when arch is x86.
188
192
//
193
+ // This function is unsafe because it uses a custom ABI, it does not actually match `extern "C"`.
194
+ //
189
195
// REF: Rust commit(74e80468347)
190
196
// rust\src\llvm-project\llvm\lib\Target\X86\X86FrameLowering.cpp: 805
191
197
// Comments in LLVM:
You can’t perform that action at this time.
0 commit comments