aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordglead <none@none>2010-12-28 19:52:41 -0800
committerdglead <none@none>2010-12-28 19:52:41 -0800
commit5b7fda278c5f613835ea1a84ef0b39baa4e87936 (patch)
tree682978497f717168389bbc865a8da6f2d0e214d4 /src
parent27c9f996cfc6a4e8a3e03630588ab68349fe4d17 (diff)
handle memmove of 0
Diffstat (limited to 'src')
-rw-r--r--src/preamble.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/preamble.js b/src/preamble.js
index 8c954d0d..4eb99d18 100644
--- a/src/preamble.js
+++ b/src/preamble.js
@@ -388,6 +388,7 @@ _memcpy = _llvm_memcpy_i64 = _llvm_memcpy_p0i8_p0i8_i32 = _llvm_memcpy_p0i8_p0i8
function _llvm_memmove_i32(dest, src, num, idunno) {
// not optimized!
+ if (num === 0) return; // will confuse malloc if 0
var tmp = _malloc(num);
_memcpy(tmp, src, num);
_memcpy(dest, tmp, num);