Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/facebook/luaffifb.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Gross <colesbury@gmail.com>2015-04-27 23:17:55 +0300
committerSam Gross <colesbury@gmail.com>2015-04-28 20:58:46 +0300
commitec9e4eae9746304e449ce126bf54ee44dff26140 (patch)
tree12a3392ab3c034204f212e81d9a0841a252513ec
parent04b74bedf50c04224726f7d6565d890e662357d2 (diff)
Align 64-bit ints on 8-byte boundaries when on the stack.
-rw-r--r--call_x64.h3
-rw-r--r--call_x64win.h3
-rw-r--r--call_x86.dasc3
-rw-r--r--call_x86.h3
4 files changed, 12 insertions, 0 deletions
diff --git a/call_x64.h b/call_x64.h
index 8fd89bb..e0acdee 100644
--- a/call_x64.h
+++ b/call_x64.h
@@ -392,6 +392,9 @@ static void add_int(Dst_DECL, const struct ctype* ct, struct reg_alloc* reg, int
#endif
else if (is_int64) {
+ if (reg->off % 8 != 0) {
+ reg->off += 8 - (reg->off % 8);
+ }
dasm_put(Dst, 313, reg->off);
reg->off += 8;
} else {
diff --git a/call_x64win.h b/call_x64win.h
index 3362af1..99306b8 100644
--- a/call_x64win.h
+++ b/call_x64win.h
@@ -387,6 +387,9 @@ static void add_int(Dst_DECL, const struct ctype* ct, struct reg_alloc* reg, int
#endif
else if (is_int64) {
+ if (reg->off % 8 != 0) {
+ reg->off += 8 - (reg->off % 8);
+ }
dasm_put(Dst, 285, reg->off);
reg->off += 8;
} else {
diff --git a/call_x86.dasc b/call_x86.dasc
index 573b448..d7a7c4c 100644
--- a/call_x86.dasc
+++ b/call_x86.dasc
@@ -508,6 +508,9 @@ static void add_int(Dst_DECL, const struct ctype* ct, struct reg_alloc* reg, int
#endif
else if (is_int64) {
+ if (reg->off % 8 != 0) {
+ reg->off += 8 - (reg->off % 8);
+ }
|.if X64
| mov [rsp + reg->off], rax
|.else
diff --git a/call_x86.h b/call_x86.h
index a5c8855..3142aba 100644
--- a/call_x86.h
+++ b/call_x86.h
@@ -376,6 +376,9 @@ static void add_int(Dst_DECL, const struct ctype* ct, struct reg_alloc* reg, int
#endif
else if (is_int64) {
+ if (reg->off % 8 != 0) {
+ reg->off += 8 - (reg->off % 8);
+ }
dasm_put(Dst, 248, reg->off, reg->off + 4);
reg->off += 8;
} else {