aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-11-21 16:16:46 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-11-21 16:17:19 -0800
commitd4420cfec2d27ba7a55b024d92b513975f561336 (patch)
treebf117825d5bf7f9d0c4d2e10407da7cf8753192a /src/library.js
parent1b755e1334785ab616541daae251160045a866a3 (diff)
add some support for le32=2 mode, where varargs is just 4-byte aligned
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index a5380c3a..8425a10f 100644
--- a/src/library.js
+++ b/src/library.js
@@ -1855,7 +1855,11 @@ LibraryManager.library = {
// int x = 4; printf("%c\n", (char)x);
var ret;
if (type === 'double') {
+#if TARGET_LE32 == 2
+ ret = {{{ makeGetValue('varargs', 'argIndex', 'double', undefined, undefined, true, 4) }}};
+#else
ret = {{{ makeGetValue('varargs', 'argIndex', 'double', undefined, undefined, true) }}};
+#endif
#if USE_TYPED_ARRAYS == 2
} else if (type == 'i64') {
@@ -1876,7 +1880,11 @@ LibraryManager.library = {
type = 'i32'; // varargs are always i32, i64, or double
ret = {{{ makeGetValue('varargs', 'argIndex', 'i32', undefined, undefined, true) }}};
}
+#if TARGET_LE32 == 2
+ argIndex += Runtime.getNativeFieldSize(type);
+#else
argIndex += Math.max(Runtime.getNativeFieldSize(type), Runtime.getAlignSize(type, null, true));
+#endif
return ret;
}