-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix incorrect parameter offset calculation on Windows beyond argument 5
Fixes #17.
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#include "test.h" | ||
|
||
struct StructA { | ||
int x1, x2, x3; | ||
}; | ||
|
||
void func(int dummy1, | ||
int dummy2, | ||
int dummy3, | ||
int dummy4, | ||
struct StructA trigger, | ||
struct StructA bug_occurred) { | ||
// Crash was occurring due to incorrect calculation of parameter offsets when | ||
// passed by reference beyond register slots. | ||
ASSERT(0, bug_occurred.x1); | ||
ASSERT(1, bug_occurred.x2); | ||
ASSERT(2, bug_occurred.x3); | ||
} | ||
|
||
extern void XXXXX(int dummy1, | ||
int dummy2, | ||
int dummy3, | ||
int dummy4, | ||
struct StructA trigger, | ||
struct StructA bug_occurred); | ||
int main(void) { | ||
struct StructA var = {0, 1, 2}; | ||
func(1, 2, 3, 4, var, var); | ||
return 0; | ||
} |