Skip to content

Commit 65683e0

Browse files
committed
---
yaml --- r: 6857 b: refs/heads/master c: edf6e1e h: refs/heads/master i: 6855: 5cd52c6 v: v3
1 parent 1e9fb46 commit 65683e0

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-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: 586281e2d6d7f63e2b2d2b09c7f310f3b1d35355
2+
refs/heads/master: edf6e1ec0e038b805a36a7e3689b37fc3cea7387

trunk/src/rt/arch/i386/context.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,14 @@ void context::call(void *f, void *arg, void *stack) {
3131
// Shift the stack pointer so the alignment works out right.
3232
sp = align_down(sp) - 3;
3333
*--sp = (uint32_t)arg;
34-
*--sp = 0xdeadbeef;
34+
// The final return address. 0 indicates the bottom of the stack
35+
*--sp = 0;
3536

3637
regs.esp = (uint32_t)sp;
3738
regs.eip = (uint32_t)f;
39+
40+
// Last base pointer on the stack should be 0
41+
regs.ebp = 0;
3842
}
3943

4044
#if 0

trunk/src/rt/arch/x86_64/context.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,13 @@ void context::call(void *f, void *arg, void *stack) {
2828
// set up the stack
2929
uint64_t *sp = (uint64_t *)stack;
3030
sp = align_down(sp);
31-
*--sp = 0xdeadbeef; // takes place of ret. addr.
31+
// The final return address. 0 indicates the bottom of the stack
32+
*--sp = 0;
3233

3334
regs.data[RUSTRT_ARG0] = (uint64_t)arg;
3435
regs.data[RUSTRT_RSP] = (uint64_t)sp;
3536
regs.data[RUSTRT_IP] = (uint64_t)f;
37+
38+
// Last base pointer on the stack should be 0
39+
regs.data[RUSTRT_RBP] = 0;
3640
}

0 commit comments

Comments
 (0)