Handle memory errors occurring in wasm scanners
* In WASM, use a custom, simple malloc implementation that lets us expicitly reset the heap with a new start location. * When a WASM call traps or errors, propagate that as a parse failure. * Reset the WASM heap after every parse. Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
parent
b19d85aca7
commit
7a9b3076ef
9 changed files with 1795 additions and 2384 deletions
|
|
@ -9,7 +9,8 @@ extern "C" {
|
|||
#include "./parser.h"
|
||||
|
||||
bool ts_wasm_store_start(TSWasmStore *, TSLexer *, const TSLanguage *);
|
||||
void ts_wasm_store_stop(TSWasmStore *);
|
||||
void ts_wasm_store_reset(TSWasmStore *);
|
||||
bool ts_wasm_store_has_error(const TSWasmStore *);
|
||||
|
||||
bool ts_wasm_store_call_lex_main(TSWasmStore *, TSStateId);
|
||||
bool ts_wasm_store_call_lex_keyword(TSWasmStore *, TSStateId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue