[backend]引入了栈上的20字节安全区

This commit is contained in:
Lixuanwang
2025-07-22 21:36:22 +08:00
parent 20a5c5cbfb
commit b20bda2f52

View File

@@ -27,7 +27,8 @@ void RISCv64RegAlloc::run() {
void RISCv64RegAlloc::eliminateFrameIndices() {
StackFrameInfo& frame_info = MFunc->getFrameInfo();
int current_offset = 0;
int current_offset = 20; // 这里写20是为了在$s0和第一个变量之间留出20字节的安全区
// 以防止一些函数调用方面的恶性bug。
Function* F = MFunc->getFunc();
RISCv64ISel* isel = MFunc->getISel();