Skip to content

Commit 82f92e6

Browse files
committed
---
yaml --- r: 6769 b: refs/heads/master c: 9d70c19 h: refs/heads/master i: 6767: 869bcb2 v: v3
1 parent 1909ad3 commit 82f92e6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 23df4de86d8740545891a745f3c2f6c90cf1d1fd
2+
refs/heads/master: 9d70c1949e4c26cc558525b242714efb3e8eb212

trunk/src/rt/arch/i386/morestack.S

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ MORESTACK:
6464
// NB: This can be called with the fastcc convention so we
6565
// have to preserve any argument registers we want to use
6666

67+
// NB: __morestack is called misaligned by 4 bytes, i.e.
68+
// subl $4, %esp would get us to a normal alignment
69+
6770
// FIXME (1226): main is compiled with the split-stack prologue,
6871
// causing it to call __morestack, so we have to jump back out
6972
subl $28,%esp
@@ -120,7 +123,9 @@ MORESTACK:
120123
// Switch back to the rust stack
121124
movl %ebp, %esp
122125

123-
subl $8, %esp // Alignment
126+
// Remember that __morestack is called misaligned so %ebp
127+
// is not aligned to a 16-byte boundary, these 4 bytes realign.
128+
subl $4, %esp
124129

125130
// Now that we're on the return path we want to avoid
126131
// stomping on %eax. FIXME: Need to save and restore
@@ -137,7 +142,7 @@ MORESTACK:
137142
pushl $0
138143
call UPCALL_CALL_C
139144

140-
addl $16,%esp
145+
addl $12,%esp
141146

142147
popl %ebp
143148
#if defined(__linux__) || defined(__APPLE__)

0 commit comments

Comments
 (0)