summaryrefslogtreecommitdiff
path: root/test/empty.asm.js
diff options
context:
space:
mode:
authorLogan Chien <tzuhsiang.chien@gmail.com>2016-08-26 02:13:00 +0800
committerLogan Chien <tzuhsiang.chien@gmail.com>2016-08-26 02:47:00 +0800
commita008d4fd7af3b04a3d351a03d56df7c28998690e (patch)
treee82a2dc300b867ff995b856f1c4d0e503af251b2 /test/empty.asm.js
parenta08643d788dd025345c63798f2e3ed7ca9b12e06 (diff)
downloadbinaryen-a008d4fd7af3b04a3d351a03d56df7c28998690e.tar.gz
binaryen-a008d4fd7af3b04a3d351a03d56df7c28998690e.tar.bz2
binaryen-a008d4fd7af3b04a3d351a03d56df7c28998690e.zip
Fix asm2wasm dead lock caused by empty modules.
This commit fixes an asm2wasm dead lock when asm2wasm is compiling an empty module, i.e. a module without any functions. Without this commit, worker threads are likely to leave `workerMain()` and decrease `liveWorkers` early. Consequently, `waitUntilAllReady()` will never observe `liveWorkers == numWorkers`.
Diffstat (limited to 'test/empty.asm.js')
-rw-r--r--test/empty.asm.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/test/empty.asm.js b/test/empty.asm.js
new file mode 100644
index 000000000..94fa6bb38
--- /dev/null
+++ b/test/empty.asm.js
@@ -0,0 +1,4 @@
+function EmptyModule() {
+ 'use asm';
+ return {};
+}