aboutsummaryrefslogtreecommitdiff
path: root/tests/zlib
diff options
context:
space:
mode:
authorAlon Zakai <azakai@mozilla.com>2011-02-13 21:01:26 -0800
committerAlon Zakai <azakai@mozilla.com>2011-02-13 21:01:26 -0800
commita24e070ab3d7497d52d0808159accbb9f6461020 (patch)
treecedbfc4f41d01c4cbf89b31e53fae67c1131a35d /tests/zlib
parent4c884d8526826ee15ba4475b7bc0c9acb4c609bb (diff)
tweak sign and overflow checks
Diffstat (limited to 'tests/zlib')
-rw-r--r--tests/zlib/trees.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/zlib/trees.c b/tests/zlib/trees.c
index 56e9bb1c..18be5013 100644
--- a/tests/zlib/trees.c
+++ b/tests/zlib/trees.c
@@ -722,7 +722,11 @@ local void scan_tree (s, tree, max_code)
int min_count = 4; /* min repeat count */
if (nextlen == 0) max_count = 138, min_count = 3;
+#ifndef EMSCRIPTEN_OPTS
tree[max_code+1].Len = (ush)0xffff; /* guard */
+#else
+ tree[max_code+1].Len = (ush)0x7fff; /* guard. Emscripten: Prevents llvm_gcc from creating '-1' which needs unsigning later */
+#endif
for (n = 0; n <= max_code; n++) {
curlen = nextlen; nextlen = tree[n+1].Len;