mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
compiler: fix mark_var_used()
This commit is contained in:
committed by
Alexander Medvednikov
parent
f7d8fb0cf4
commit
a44a03f9a5
@@ -69,7 +69,7 @@ fn (p mut Parser) open_scope() {
|
||||
}
|
||||
|
||||
fn (p mut Parser) mark_var_used(v Var) {
|
||||
if v.idx == -1 {
|
||||
if v.idx == -1 || v.idx >= p.local_vars.len {
|
||||
return
|
||||
}
|
||||
p.local_vars[v.idx].is_used = true
|
||||
|
||||
Reference in New Issue
Block a user