mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
scanner: fix a string overflow
This commit is contained in:
parent
8f1bf6033e
commit
df593870ae
@ -564,6 +564,9 @@ fn (s mut Scanner) scan() ScanRes {
|
||||
}
|
||||
|
||||
fn (s &Scanner) find_current_line_start_position() int {
|
||||
if s.pos >= s.text.len {
|
||||
return s.pos
|
||||
}
|
||||
mut linestart := s.pos
|
||||
for {
|
||||
if linestart <= 0 {break}
|
||||
|
Loading…
Reference in New Issue
Block a user