diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-11-16 20:51:15 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-11-16 20:51:15 -0800 |
commit | e2c5a4daa5af7c9130d616ebc68b23ec465fa1f9 (patch) | |
tree | c3a33ba16bd2664a2162081f926319ea53912da0 /src/library.js | |
parent | bcf1a4f0e90b93a7771058fda56e4be1046af38a (diff) |
do not fail on malloc(0)
Diffstat (limited to 'src/library.js')
-rw-r--r-- | src/library.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js index 8127ece4..8c3740b3 100644 --- a/src/library.js +++ b/src/library.js @@ -3143,7 +3143,9 @@ LibraryManager.library = { // stdlib.h // ========================================================================== - malloc: Runtime.staticAlloc, + malloc: function(bytes) { + return Runtime.staticAlloc(bytes || 1); // accept 0 as an input because libc implementations tend to + }, _Znwj: 'malloc', _Znaj: 'malloc', _Znam: 'malloc', |