mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 09:51:41 +00:00
[gamecode] Improve callchain test
Add another function call to further mess up the return value address and verify just where it is pointing.
This commit is contained in:
parent
89e120ba34
commit
306fcbfbd0
1 changed files with 5 additions and 1 deletions
|
@ -136,7 +136,7 @@ static dstatement_t call32_statements[] = {
|
|||
};
|
||||
|
||||
static pr_ivec4_t callchain_init[32] = {
|
||||
{ 0, 2, 3, 0 },
|
||||
{ 0, 2, 3, 4 },
|
||||
{ DB, DB, DB, DB },
|
||||
};
|
||||
|
||||
|
@ -152,17 +152,21 @@ static dstatement_t callchain_statements[] = {
|
|||
{ OP_LEA_C, STK, -4, STK }, // reserve 4 words on the stack
|
||||
{ OP_WITH, 2, 0, 2 }, // put locals into reg 2
|
||||
{ OP(0, 0, 2, OP_CALL_B), 2, 0, 0 },
|
||||
{ OP(0, 0, 2, OP_CALL_B), 2, 0, 1 },
|
||||
{ OP(2, 0, 0, OP_RETURN), 0, 0, 0 },
|
||||
[64]=
|
||||
{ OP_LEA_C, STK, -4, STK }, // reserve 4 words on the stack
|
||||
{ OP_WITH, 2, 0, 2 }, // put locals into reg 2
|
||||
{ OP(0, 0, 2, OP_LEA_A), 42, 0, 0 }, // init value
|
||||
{ OP(2, 0, 0, OP_RETURN), 0, 0, 0 }, // return value
|
||||
[96]=
|
||||
{ OP_RETURN, 0, 0, -1 } // void return
|
||||
};
|
||||
|
||||
static bfunction_t callret_functions[] = {
|
||||
{ .first_statement = 32 },
|
||||
{ .first_statement = 64 },
|
||||
{ .first_statement = 96 },
|
||||
};
|
||||
|
||||
test_t tests[] = {
|
||||
|
|
Loading…
Reference in a new issue