Fix a crash bug caused by a nested call of parallelForEach.
authorRui Ueyama <ruiu@google.com>
Wed, 17 Apr 2019 02:12:47 +0000 (02:12 +0000)
committerRui Ueyama <ruiu@google.com>
Wed, 17 Apr 2019 02:12:47 +0000 (02:12 +0000)
commit5081e41bdae2eb14a3f3eb8810263f9fea8fc7c1
tree29bfe969bcf97418b484837249b0beaca4f93ef9
parenta86343512845c9c1fdbac865fea88aa5fce7142a
Fix a crash bug caused by a nested call of parallelForEach.

parallelForEach is not reentrant. We use parallelForEach to call
each section's writeTo(), so calling the same function within writeTo()
is not safe.

Fixes https://bugs.llvm.org/show_bug.cgi?id=41508

Differential Revision: https://reviews.llvm.org/D60757

llvm-svn: 358547
lld/wasm/OutputSections.cpp