summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWouter van Oortmerssen <aardappel@gmail.com>2020-01-27 16:52:53 -0800
committerGitHub <noreply@github.com>2020-01-27 16:52:53 -0800
commitc74e612ff9d95d6afd1bbfb6d9656655aa6d70ed (patch)
treec93334a9d4f8f6dc44d5f8c5490f541f08bb9e52 /src
parentb0be627636428a949609e2b18daf347600105be8 (diff)
downloadwabt-c74e612ff9d95d6afd1bbfb6d9656655aa6d70ed.tar.gz
wabt-c74e612ff9d95d6afd1bbfb6d9656655aa6d70ed.tar.bz2
wabt-c74e612ff9d95d6afd1bbfb6d9656655aa6d70ed.zip
wasm-decompile: Fix access of undefined symbols. (#1319)
Diffstat (limited to 'src')
-rw-r--r--src/binary-reader-ir.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/binary-reader-ir.cc b/src/binary-reader-ir.cc
index 9f16a380..9ebd1252 100644
--- a/src/binary-reader-ir.cc
+++ b/src/binary-reader-ir.cc
@@ -1255,6 +1255,10 @@ Result BinaryReaderIR::OnDataSymbol(Index index, uint32_t flags,
if (name.empty()) {
return Result::Ok;
}
+ if (flags & WABT_SYMBOL_FLAG_UNDEFINED) {
+ // Refers to data in another file, `segment` not valid.
+ return Result::Ok;
+ }
if (offset) {
// If it is pointing into the data segment, then it's not really naming
// the whole segment.