summaryrefslogtreecommitdiff
path: root/src/wasm-ast-parser-lexer-shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-ast-parser-lexer-shared.c')
-rw-r--r--src/wasm-ast-parser-lexer-shared.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wasm-ast-parser-lexer-shared.c b/src/wasm-ast-parser-lexer-shared.c
index 94d5fc2b..dc06b36a 100644
--- a/src/wasm-ast-parser-lexer-shared.c
+++ b/src/wasm-ast-parser-lexer-shared.c
@@ -70,3 +70,13 @@ void wasm_ast_format_error(WasmSourceErrorHandler* error_handler,
}
va_end(args_copy);
}
+
+void wasm_destroy_text_list(WasmAllocator* allocator, WasmTextList* text_list) {
+ WasmTextListNode* node = text_list->first;
+ while (node) {
+ WasmTextListNode* next = node->next;
+ wasm_destroy_string_slice(allocator, &node->text);
+ wasm_free(allocator, node);
+ node = next;
+ }
+}