diff options
author | Ben Smith <binjimin@gmail.com> | 2017-09-14 19:06:19 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-14 19:06:19 -0700 |
commit | 15c4a0021cfcd8561779dfde07ff9e380bc12b7b (patch) | |
tree | 468e6b58f31f54badcecad7eae8c68ef8128c4f5 /src/binary-reader-interpreter.cc | |
parent | 18f7772c47f0720fbaa38a01e6892826705ec26f (diff) | |
download | wabt-15c4a0021cfcd8561779dfde07ff9e380bc12b7b.tar.gz wabt-15c4a0021cfcd8561779dfde07ff9e380bc12b7b.tar.bz2 wabt-15c4a0021cfcd8561779dfde07ff9e380bc12b7b.zip |
Fix potential use-after-free in WastLexer (#626)
Fixes issue #623.
* Move Token into its own file.
* Add WastParser tests. These ones are used because the source text is
very large, and it may be useful to generate parser tests
programmatically in the future too.
* Reorganize TokenType by the union data member it uses. This makes it
easier to determine which member needs to be
constructed/copied/destroyed.
- Bare (no data)
- Literal
- Opcode
- String
- Type
* Make Token store its string/literal data directly, rather than share
with lexer. This actually fixes the bug.
* Fix a couple of line-printing bugs:
- Very long tokens (e.g. "a" 20000 times) are now clamped to 80 chars.
- Very long lines are displayed properly in errors (e.g. a line with
65000 columns).
Diffstat (limited to 'src/binary-reader-interpreter.cc')
0 files changed, 0 insertions, 0 deletions