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
5208
5208
if (deduced_type) {
5209
5209
auto & type = std::get<declaration_node::an_object>(n->type );
5210
5210
// 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) {
5212
5212
type->address_of = &curr ();
5213
5213
}
5214
5214
// 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) {
5216
5216
type->dereference_of = &curr ();
5217
5217
for (int i = 1 ; peek (i)->type () == lexeme::Multiply; ++i)
5218
5218
type->dereference_cnt += 1 ;
5219
5219
}
5220
5220
else if (
5221
5221
// 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)
5223
5223
|| curr ().type () == lexeme::Identifier // or by the object (variable that the type need to be checked)
5224
5224
) {
5225
5225
type->suspicious_initialization = &curr ();
You can’t perform that action at this time.
0 commit comments