Assertion failure `it != implicitTypes.end()` in wasm::WATParser::ParseModuleTypesCtx::makeTypeUse at contexts.h:1474 (main branch @3ef8d19)
@tlively đang làm issue này rồi.
Từ ngày 21/4/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
Summary
An assertion failure is triggered in wasm::WATParser::ParseModuleTypesCtx::makeTypeUse() when parsing malformed WebAssembly input with wasm-emscripten-finalize.
The assertion it != implicitTypes.end() fails when looking up an expected implicit type.
Affected Version
- Branch: main
- Commit: 3ef8d19 (2026-04-21 latest)
- Tool: wasm-emscripten-finalize
- Build type: Debug + AddressSanitizer
Reproduction
mkdir build && cd build
cmake \
-DCMAKE_C_COMPILER=/home/AFLplusplus/afl-clang-fast \
-DCMAKE_CXX_COMPILER=/home/AFLplusplus/afl-clang-fast++ \
-DCMAKE_C_FLAGS="-O0 -g -fno-omit-frame-pointer -fsanitize=address -Wno-error" \
-DCMAKE_CXX_FLAGS="-std=c++20 -O0 -g -fno-omit-frame-pointer -fsanitize=address -Wno-bitwise-instead-of-logical -Wno-ambiguous-reversed-operator -Wno-error" \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=address -no-pie -pthread -ldl -lm" \
-DCMAKE_BUILD_TYPE=Debug \
-DBUILD_TESTS=OFF \
-DBUILD_TOOLS=ON \
-DENABLE_BYESAN=OFF \
..
make -j$(nproc)
./wasm-emscripten-finalize -n poc
Error Log
wasm-emscripten-finalize: /home/new-cases/binaryen/latestest-04.21/binaryen-main/src/parser/contexts.h:1474: Result<wasm::WATParser::ParseModuleTypesCtx::TypeUseT> wasm::WATParser::ParseModuleTypesCtx::makeTypeUse(wasm::Index, std::optional<HeapTypeT>, wasm::WATParser::TypeParserCtx<wasm::WATParser::ParseModuleTypesCtx>::ParamsT *, wasm::WATParser::TypeParserCtx<wasm::WATParser::ParseModuleTypesCtx>::ResultsT *): Assertion `it != implicitTypes.end()' failed.
Root Cause
The method makeTypeUse() at contexts.h:1474 expects to find a type entry in implicitTypes,
but the input causes a lookup of a non-existent type, leading to an assertion failure.
Call chain:
wasm-emscripten-finalize parsing → ParseModuleTypesCtx::makeTypeUse() → Assertion it != implicitTypes.end() failed
PoC
- Ngôn ngữ chính
- WebAssembly
- Star
- 8.6k
- Fork
- 885
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 70
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của WebAssembly/binaryen
-
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 76/100
WebAssembly/binaryen#9018 · 3 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
WebAssembly/binaryen#9123 ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
WebAssembly/binaryen#9122 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
WebAssembly/binaryen#9086 · 2 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
WebAssembly/binaryen#9038 · 5 bình luận ·