aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2014-02-27 19:43:32 +0200
committerJukka Jylänki <jujjyl@gmail.com>2014-02-27 19:44:36 +0200
commit13fd9405aa4ede0d0713cb08ed0840bc753e1828 (patch)
treea6373be3924dc7c5204f53a3c8a4ee481e061093 /src
parent2a43c14b8458f4e5c4e7ee5b8e28d52be5f472bb (diff)
Fix bug that caused emscripten_get_callstack to not truncate the output buffer. Add test. Closes #2171.
Diffstat (limited to 'src')
-rw-r--r--src/library.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/library.js b/src/library.js
index cd451c57..62695ae7 100644
--- a/src/library.js
+++ b/src/library.js
@@ -9025,7 +9025,7 @@ LibraryManager.library = {
}
// Truncate output to avoid writing past bounds.
if (callstack.length > maxbytes-1) {
- callstack.slice(0, maxbytes-1);
+ callstack = callstack.slice(0, maxbytes-1);
}
// Output callstack string as C string to HEAP.
writeStringToMemory(callstack, str, false);