From 5c5ccd1ee31d590db982c382f0c7643ba9adf83e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionu=C8=9B=20Leonte?= Date: Sun, 7 Apr 2024 15:59:30 +0300 Subject: [PATCH] Fix a crash when auto-indenting C/C++ code. --- src/langs/common.jai | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/langs/common.jai b/src/langs/common.jai index d583c6943..00fde9638 100644 --- a/src/langs/common.jai +++ b/src/langs/common.jai @@ -119,6 +119,9 @@ tokenize_c_like_lang_for_indentation :: (using buffer: Buffer, $get_next_token: tokenizer := get_tokenizer(buffer); + // Allocate temporary space for tracking one previous token + tokenizer.prev_tokens[0] = New(Token,, temp); + while true { src := get_next_token(*tokenizer);