diff options
| author | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-03 12:33:50 +0100 |
|---|---|---|
| committer | Fabrice <fabrice@schaub-dev.xyz> | 2026-03-03 12:33:50 +0100 |
| commit | beeffb374b66bb36d16628b8596782eb98107ef7 (patch) | |
| tree | 2b6a4564d19a37fc775dcd75cda84da608176165 | |
| parent | 9c5b50bfeabd0bd56cd2f9180c4161288ca9431a (diff) | |
fox bugs
| -rw-r--r-- | src/common.cc | 2 | ||||
| -rw-r--r-- | src/tokenizer.cc | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/common.cc b/src/common.cc index 12fe710..bae29da 100644 --- a/src/common.cc +++ b/src/common.cc @@ -72,7 +72,7 @@ struct Slice { } const T* operator[](usize index) const { - assert(index < this->total_length()); + assert(index < this->length); return this->ptr + index; } diff --git a/src/tokenizer.cc b/src/tokenizer.cc index 3451f69..f2efda4 100644 --- a/src/tokenizer.cc +++ b/src/tokenizer.cc @@ -73,12 +73,12 @@ bool tokenizer_next(Tokenizer* tokenizer, Token* out) { assert_neq(tokenizer, nullptr); assert_neq(out, nullptr); - usize cursor, advance; + usize cursor; Buffer* buffer = tokenizer_get_buffer(tokenizer, &cursor); if (buffer == nullptr) return false; + usize advance = cursor; tokenizer_advance(tokenizer, &advance); - Token token = {}; tokenizer_make_token(tokenizer, &token, Token_Kind_Eof, cursor, advance); |
