aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/jsifier.js9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/jsifier.js b/src/jsifier.js
index 7901a5e3..01f1b27d 100644
--- a/src/jsifier.js
+++ b/src/jsifier.js
@@ -320,12 +320,9 @@ function JSify(data, functionsOnly, givenFunctions) {
}
// ensure alignment
- constant = constant.concat(zeros(Runtime.alignMemory(constant.length) - constant.length));
-
- // Special case: class vtables. We make sure they are null-terminated, to allow easy runtime operations
- if (item.ident.substr(0, 5) == '__ZTV') {
- constant = constant.concat(zeros(Runtime.alignMemory(QUANTUM_SIZE)));
- }
+ var extra = Runtime.alignMemory(constant.length) - constant.length;
+ if (item.ident.substr(0, 5) == '__ZTV') extra += Runtime.alignMemory(QUANTUM_SIZE);
+ while (extra-- > 0) constant.push(0);
}
// NOTE: This is the only place that could potentially create static