about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorBaitinq <[email protected]>2025-07-16 12:02:20 +0200
committerBaitinq <[email protected]>2025-07-16 12:02:20 +0200
commit45b11f5197536acee0d30edd8d16c3dcb1c48329 (patch)
tree7d04d037a9dd4092ab877cafab136e8d7f141966 /src
parentCodegen: Assert that function ends in return (diff)
downloadpry-lang-45b11f5197536acee0d30edd8d16c3dcb1c48329.tar.gz
pry-lang-45b11f5197536acee0d30edd8d16c3dcb1c48329.tar.bz2
pry-lang-45b11f5197536acee0d30edd8d16c3dcb1c48329.zip
Tokenizer: Add bounds checking for consume_until_condition
Diffstat (limited to 'src')
-rw-r--r--src/tokenizer.pry3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tokenizer.pry b/src/tokenizer.pry
index c809420..78b472a 100644
--- a/src/tokenizer.pry
+++ b/src/tokenizer.pry
@@ -226,6 +226,9 @@ let tokenizer_consume_until_condition = (t: *tokenizer, condition: (i8) => bool)
 
 		let offset = (*t).offset;
 		if c == '\\' {
+			if offset >= (*t).buf_len {
+				return res;
+			};
 			let next_c = (*((*t).buf + cast(*i8, offset + 1)));
 		
 			let any = false;