aboutsummaryrefslogtreecommitdiff
path: root/src/library.js
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-08-07 17:30:53 -0700
committerAlon Zakai <alonzakai@gmail.com>2013-08-07 17:30:53 -0700
commit1cb8ef33e79e6f5a469d23910880720de14336fe (patch)
tree20296993bd1e61ee2447bf04b0a2c7f3c6c0f6fd /src/library.js
parente20ca6690ca787bd0289e945de60b1c5d09f28ae (diff)
manually fill heap history in write targets of VFS.write|read into the heap
Diffstat (limited to 'src/library.js')
-rw-r--r--src/library.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/library.js b/src/library.js
index adf21a8c..6ef065e0 100644
--- a/src/library.js
+++ b/src/library.js
@@ -2701,6 +2701,11 @@ LibraryManager.library = {
}
try {
var slab = {{{ makeGetSlabs('buf', 'i8', true) }}};
+#if SAFE_HEAP
+#if USE_TYPED_ARRAYS == 0
+ SAFE_HEAP_FILL_HISTORY(buf, buf+nbyte, 'i8'); // VFS does not use makeSetValues, so we need to do it manually
+#endif
+#endif
return VFS.read(stream, slab, buf, nbyte, offset);
} catch (e) {
FS.handleFSError(e);
@@ -2723,6 +2728,11 @@ LibraryManager.library = {
try {
var slab = {{{ makeGetSlabs('buf', 'i8', true) }}};
+#if SAFE_HEAP
+#if USE_TYPED_ARRAYS == 0
+ SAFE_HEAP_FILL_HISTORY(buf, buf+nbyte, 'i8'); // VFS does not use makeSetValues, so we need to do it manually
+#endif
+#endif
return VFS.read(stream, slab, buf, nbyte);
} catch (e) {
FS.handleFSError(e);
@@ -2824,6 +2834,11 @@ LibraryManager.library = {
}
try {
var slab = {{{ makeGetSlabs('buf', 'i8', true) }}};
+#if SAFE_HEAP
+#if USE_TYPED_ARRAYS == 0
+ SAFE_HEAP_FILL_HISTORY(buf, buf+nbyte, 'i8'); // VFS does not use makeSetValues, so we need to do it manually
+#endif
+#endif
return VFS.write(stream, slab, buf, nbyte, offset);
} catch (e) {
FS.handleFSError(e);
@@ -2846,6 +2861,11 @@ LibraryManager.library = {
try {
var slab = {{{ makeGetSlabs('buf', 'i8', true) }}};
+#if SAFE_HEAP
+#if USE_TYPED_ARRAYS == 0
+ SAFE_HEAP_FILL_HISTORY(buf, buf+nbyte, 'i8'); // VFS does not use makeSetValues, so we need to do it manually
+#endif
+#endif
return VFS.write(stream, slab, buf, nbyte);
} catch (e) {
FS.handleFSError(e);