aboutsummaryrefslogtreecommitdiff
path: root/src/parseTools.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-04-04 15:55:46 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-04-04 15:55:46 -0700
commit4fbbfb2d27b64a3eb96851e60d453d59e1e2d6a0 (patch)
treef8bccb7a9569e9bfcd10df6608e5e463ca581de6 /src/parseTools.js
parent538b6b0bcc12c58d841fd11130a9b16cfaf3d81e (diff)
make sure allocate() types have the same length as the slab
Diffstat (limited to 'src/parseTools.js')
-rw-r--r--src/parseTools.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/parseTools.js b/src/parseTools.js
index 95dc46e0..cec9afb3 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -1569,6 +1569,9 @@ function makePointer(slab, pos, allocator, type, ptr, finalMemoryInitialization)
if (typeof slab == 'object' && slab.length > chunkSize) {
slab = chunkify(slab);
}
+ if (typeof types == 'object') {
+ while (types.length < slab.length) types.push(0);
+ }
if (typeof types != 'string' && types.length > chunkSize) {
types = chunkify(types);
} else {