aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/library.js5
-rw-r--r--src/parseTools.js2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/library.js b/src/library.js
index cc28ce6f..56583c76 100644
--- a/src/library.js
+++ b/src/library.js
@@ -3302,8 +3302,9 @@ LibraryManager.library = {
}
var info = FS.streams[stream];
if (!info) return -1;
- return allocate(info.object.contents.slice(offset, offset+num),
- 'i8', ALLOC_NORMAL);
+ var contents = info.object.contents;
+ contents = Array.prototype.slice.call(contents, offset, offset+num);
+ return allocate(contents, 'i8', ALLOC_NORMAL);
},
__01mmap64_: 'mmap',
diff --git a/src/parseTools.js b/src/parseTools.js
index 22f38207..428c2b25 100644
--- a/src/parseTools.js
+++ b/src/parseTools.js
@@ -123,7 +123,7 @@ function isPointerType(type) {
function isStructType(type) {
if (isPointerType(type)) return false;
if (/^\[\d+\ x\ (.*)\]/.test(type)) return true; // [15 x ?] blocks. Like structs
- if (/<?{ [^}]* }>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types
+ if (/<?{ ?[^}]* ?}>?/.test(type)) return true; // { i32, i8 } etc. - anonymous struct types
// See comment in isStructPointerType()
return type[0] == '%';
}