1
0
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:
joe-conigliaro
2019-09-24 13:18:06 +10:00
committed by Alexander Medvednikov
parent f7d8fb0cf4
commit a44a03f9a5
2 changed files with 5 additions and 5 deletions

View File

@@ -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