File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -5208,18 +5208,18 @@ class parser
52085208 if (deduced_type) {
52095209 auto & type = std::get<declaration_node::an_object>(n->type );
52105210 // object initialized by the address of the curr() object
5211- if (peek (1 )->type () == lexeme::Ampersand) {
5211+ if (peek (1 ) && peek ( 1 ) ->type () == lexeme::Ampersand) {
52125212 type->address_of = &curr ();
52135213 }
52145214 // object initialized by (potentially multiple) dereference of the curr() object
5215- else if (peek (1 )->type () == lexeme::Multiply) {
5215+ else if (peek (1 ) && peek ( 1 ) ->type () == lexeme::Multiply) {
52165216 type->dereference_of = &curr ();
52175217 for (int i = 1 ; peek (i)->type () == lexeme::Multiply; ++i)
52185218 type->dereference_cnt += 1 ;
52195219 }
52205220 else if (
52215221 // object initialized by the result of the function call (and it is not unnamed function)
5222- (peek (1 )->type () == lexeme::LeftParen && curr ().type () != lexeme::Colon)
5222+ (peek (1 ) && peek ( 1 ) ->type () == lexeme::LeftParen && curr ().type () != lexeme::Colon)
52235223 || curr ().type () == lexeme::Identifier // or by the object (variable that the type need to be checked)
52245224 ) {
52255225 type->suspicious_initialization = &curr ();
You can’t perform that action at this time.
0 commit comments