Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
ec791200
Commit
ec791200
authored
Sep 21, 2018
by
Michael Droettboom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix LZ4 decoding bug
This was introduced in #170, but wasn't caught since emsdk didn't get rebuilt
parent
5fb84895
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
5 deletions
+11
-5
.circleci/config.yml
.circleci/config.yml
+2
-2
emsdk/patches/lz4_c.patch
emsdk/patches/lz4_c.patch
+9
-3
No files found.
.circleci/config.yml
View file @
ec791200
...
@@ -53,7 +53,7 @@ jobs:
...
@@ -53,7 +53,7 @@ jobs:
-
restore_cache
:
-
restore_cache
:
keys
:
keys
:
-
v1-emsdk-{{ checksum "emsdk/Makefile" }}-v
6
-
-
v1-emsdk-{{ checksum "emsdk/Makefile" }}-v
7
-
-
run
:
-
run
:
name
:
build
name
:
build
...
@@ -68,7 +68,7 @@ jobs:
...
@@ -68,7 +68,7 @@ jobs:
paths
:
paths
:
-
./emsdk/emsdk
-
./emsdk/emsdk
-
~/.ccache
-
~/.ccache
key
:
v1-emsdk-{{ checksum "emsdk/Makefile" }}-v
6
-{{ .BuildNum }}
key
:
v1-emsdk-{{ checksum "emsdk/Makefile" }}-v
7
-{{ .BuildNum }}
-
persist_to_workspace
:
-
persist_to_workspace
:
root
:
.
root
:
.
...
...
emsdk/patches/lz4_c.patch
View file @
ec791200
...
@@ -52,7 +52,7 @@ index 4c3f583b7..5291002a4 100644
...
@@ -52,7 +52,7 @@ index 4c3f583b7..5291002a4 100644
var contents = stream.node.contents;
var contents = stream.node.contents;
var compressedData = contents.compressedData;
var compressedData = contents.compressedData;
var written = 0;
var written = 0;
@@ -122,
6 +117,8
@@
mergeInto(LibraryManager.library, {
@@ -122,
11 +117,14
@@
mergeInto(LibraryManager.library, {
var chunkIndex = Math.floor(start / LZ4.CHUNK_SIZE);
var chunkIndex = Math.floor(start / LZ4.CHUNK_SIZE);
var compressedStart = compressedData.offsets[chunkIndex];
var compressedStart = compressedData.offsets[chunkIndex];
var compressedSize = compressedData.sizes[chunkIndex];
var compressedSize = compressedData.sizes[chunkIndex];
...
@@ -61,7 +61,13 @@ index 4c3f583b7..5291002a4 100644
...
@@ -61,7 +61,13 @@ index 4c3f583b7..5291002a4 100644
var currChunk;
var currChunk;
if (compressedData.successes[chunkIndex]) {
if (compressedData.successes[chunkIndex]) {
var found = compressedData.cachedIndexes.indexOf(chunkIndex);
var found = compressedData.cachedIndexes.indexOf(chunkIndex);
@@ -138,18 +135,19 @@
mergeInto(LibraryManager.library, {
if (found >= 0) {
currChunk = compressedData.cachedChunks[found];
+ buffer.set(Module.HEAPU8.subarray(currChunk + startInChunk, currChunk + endInChunk), offset + written);
} else {
// decompress the chunk
compressedData.cachedIndexes.pop();
@@ -138,18 +136,19 @@
mergeInto(LibraryManager.library, {
Module['decompressedChunks'] = (Module['decompressedChunks'] || 0) + 1;
Module['decompressedChunks'] = (Module['decompressedChunks'] || 0) + 1;
}
}
var compressed = compressedData.data.subarray(compressedStart, compressedStart + compressedSize);
var compressed = compressedData.data.subarray(compressedStart, compressedStart + compressedSize);
...
@@ -89,7 +95,7 @@ index 4c3f583b7..5291002a4 100644
...
@@ -89,7 +95,7 @@ index 4c3f583b7..5291002a4 100644
var currWritten = endInChunk - startInChunk;
var currWritten = endInChunk - startInChunk;
written += currWritten;
written += currWritten;
}
}
@@ -181,4 +1
79
,3 @@
if (LibraryManager.library['$FS__deps']) {
@@ -181,4 +1
80
,3 @@
if (LibraryManager.library['$FS__deps']) {
warn('FS does not seem to be in use (no preloaded files etc.), LZ4 will not do anything');
warn('FS does not seem to be in use (no preloaded files etc.), LZ4 will not do anything');
}
}
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment