Skip to content

Commit

Permalink
fix: corrected a problem where Tokens with a null buffer could have a…
Browse files Browse the repository at this point in the history
… length different from 0 in certain cases.
  • Loading branch information
jacopodl committed Dec 1, 2023
1 parent 982d48a commit 8c8e72c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions argon/lang/scanner/scanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,7 @@ bool Scanner::NextToken(Token *out_token) noexcept {

this->peeked.type = TokenType::TK_NULL;
this->peeked.buffer = nullptr;
this->peeked.length = 0;

return true;
}
Expand Down
1 change: 1 addition & 0 deletions argon/lang/scanner/token.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ namespace argon::lang::scanner {
this->loc = other.loc;

other.buffer = nullptr;
other.length = 0;

return *this;
}
Expand Down

0 comments on commit 8c8e72c

Please sign in to comment.