Skip to content

Commit

Permalink
Fix unitialized state_data_2 in C lexer.
Browse files Browse the repository at this point in the history
  • Loading branch information
ondrap committed Aug 31, 2015
1 parent d851233 commit 1b1cbd0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion c_lib/lexer.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@ static inline int handle_base(const char *input, struct lexer *lexer, struct lex
case '}': add_simple_res(RES_CLOSE_BRACE, lexer, 1, result); lexer->position++;break;
case '[': add_simple_res(RES_OPEN_BRACKET, lexer, 1, result); lexer->position++;break;
case ']': add_simple_res(RES_CLOSE_BRACKET, lexer, 1, result); lexer->position++;break;
case '"': lexer->current_state = STATE_STRING; lexer->state_data = 0; lexer->position++;return LEX_OK;
case '"': lexer->current_state = STATE_STRING;
lexer->state_data = 0;
lexer->state_data_2 = 0;
lexer->position++;
return LEX_OK;
case 't': lexer->current_state = STATE_TRUE; lexer->state_data = 1; lexer->position++;return LEX_OK;
case 'f': lexer->current_state = STATE_FALSE; lexer->state_data = 1; lexer->position++;return LEX_OK;
case 'n': lexer->current_state = STATE_NULL; lexer->state_data = 1; lexer->position++;return LEX_OK;
Expand Down

0 comments on commit 1b1cbd0

Please sign in to comment.