summaryrefslogtreecommitdiff
path: root/src/wasm/wat-lexer.cpp
diff options
context:
space:
mode:
authorThomas Lively <tlively@google.com>2022-10-12 18:52:51 -0500
committerGitHub <noreply@github.com>2022-10-12 16:52:51 -0700
commit75418f6a8a85ef6c1fd100cdae97348140ed3184 (patch)
tree233d7e42af0905bd1a9d2cc5ca5a01ab7e3867e6 /src/wasm/wat-lexer.cpp
parentf04fafebe8cb3aaa5751bffc2ab1e7695f7b17bb (diff)
downloadbinaryen-75418f6a8a85ef6c1fd100cdae97348140ed3184.tar.gz
binaryen-75418f6a8a85ef6c1fd100cdae97348140ed3184.tar.bz2
binaryen-75418f6a8a85ef6c1fd100cdae97348140ed3184.zip
[Parser] Parse instructions with children (#5129)
Parse unary, binary, drop, and select instructions, properly fixing up stacky code, unreachable code, and multivalue code so it can be represented in Binaryen IR.
Diffstat (limited to 'src/wasm/wat-lexer.cpp')
-rw-r--r--src/wasm/wat-lexer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/wasm/wat-lexer.cpp b/src/wasm/wat-lexer.cpp
index c7959295c..80dda44b0 100644
--- a/src/wasm/wat-lexer.cpp
+++ b/src/wasm/wat-lexer.cpp
@@ -943,7 +943,7 @@ void Lexer::lexToken() {
}
TextPos Lexer::position(const char* c) const {
- assert(size_t(c - buffer.data()) < buffer.size());
+ assert(size_t(c - buffer.data()) <= buffer.size());
TextPos pos{1, 0};
for (const char* p = buffer.data(); p != c; ++p) {
if (*p == '\n') {