Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

Commit 6e5ba4e

Browse files
committedNov 5, 2023
fix: do not proceed with parse if TSParserInternal.begin_round() fails
1 parent 8c39b14 commit 6e5ba4e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎android-tree-sitter/src/main/cpp/ts_parser.cc

+3-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ Java_com_itsaky_androidide_treesitter_TSParser_00024Native_parse(JNIEnv *env,
224224
TSTree *old_tree = tree_pointer == 0 ? nullptr : (TSTree *) tree_pointer;
225225
auto *source = as_str(str_pointer);
226226

227-
ts_parser_internal->begin_round(env);
227+
if (!ts_parser_internal->begin_round(env)) {
228+
return 0;
229+
}
228230

229231
// start parsing
230232
// if the user cancels the parse while this method is being executed

0 commit comments

Comments
 (0)