aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2013-01-09 17:32:15 -0800
committerAlon Zakai <alonzakai@gmail.com>2013-01-09 17:32:15 -0800
commit308bc38fd3626084cd47fab4c65290636b8c6d84 (patch)
tree97cc9dcaeb8dc8f258685d472237167cb914d08a
parentf6d1ec0eb335433a3f93597867f46b487c124e63 (diff)
make stub memcpy more functional, useful in some tests
-rw-r--r--src/library.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js
index bc7a4d0a..74425e4f 100644
--- a/src/library.js
+++ b/src/library.js
@@ -4200,7 +4200,15 @@ LibraryManager.library = {
return ret;
},
- memcpy: function(){ throw 'memcpy should be included from libc' },
+ memcpy: function (dest, src, num) {
+ // simple version, in general it should not be used - we should pull it in from libc
+#if ASSERTIONS
+ Module.printErr('warning: library.js memcpy should not be running!');
+#endif
+ while (num--) {
+ HEAP8[dest++] = HEAP8[src++];
+ }
+ },
llvm_memcpy_i32: 'memcpy',
llvm_memcpy_i64: 'memcpy',