From 48681c3f0e6763bde7dd346eaaac7c9e8b0def3f Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 31 Oct 2017 10:04:44 -0700 Subject: [PATCH] Initialize error start and end positions at their declarations Fixes #113 Clang doesn't seem to be able to tell that these variables were guaranteed to be initialized by the time they were read. --- src/runtime/parser.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/runtime/parser.c b/src/runtime/parser.c index 9265c30f..310df80e 100644 --- a/src/runtime/parser.c +++ b/src/runtime/parser.c @@ -316,10 +316,11 @@ static Tree *parser__lex(Parser *self, StackVersion version, TSStateId parse_sta ); bool found_external_token = false; - bool skipped_error = false; bool error_mode = parse_state == ERROR_STATE; + bool skipped_error = false; int32_t first_error_character = 0; - Length error_start_position, error_end_position; + Length error_start_position = length_zero(); + Length error_end_position = length_zero(); uint32_t last_byte_scanned = start_position.bytes; ts_lexer_reset(&self->lexer, start_position);