aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2011-11-26 21:14:00 -0800
committerAlon Zakai <alonzakai@gmail.com>2011-11-26 21:14:00 -0800
commit81f82a6a0dd932344027a408ff7bf905de1d2e52 (patch)
tree9adc497b6b30f205f3ba25f03d92f81ff3eeed62 /src/parseTools.js
parent3338428a606b6a0bd2fe71d915cc2e95b373ee1f (diff)
fixes for 64-bit values in globals in i64 mode 1
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 7060dc3e..9d4b48d2 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -785,6 +785,9 @@ function calcAllocatedSize(type) {
function generateStructTypes(type) {
if (isArray(type)) return type; // already in the form of [type, type,...]
if (Runtime.isNumberType(type) || isPointerType(type)) {
+ if (I64_MODE == 1 && type == 'i64') {
+ return ['i64', 0, 0, 0, 'i32', 0, 0, 0];
+ }
return [type].concat(zeros(getNativeFieldSize(type)));
}
@@ -798,6 +801,17 @@ function generateStructTypes(type) {
for (var i = 0; i < typeData.fields.length; i++) {
var type = typeData.fields[i];
if (Runtime.isNumberType(type) || isPointerType(type)) {
+ if (I64_MODE == 1 && type == 'i64') {
+ ret[index++] = 'i64';
+ ret[index++] = 0;
+ ret[index++] = 0;
+ ret[index++] = 0;
+ ret[index++] = 'i32';
+ ret[index++] = 0;
+ ret[index++] = 0;
+ ret[index++] = 0;
+ continue;
+ }
ret[index++] = type;
} else {
add(Types.types[type]);