resolving shadoving in inlined functions correctly

This commit is contained in:
Jakub Doka 2024-10-13 16:16:27 +02:00
parent 54d93608aa
commit 2ab6f6c914
No known key found for this signature in database
GPG key ID: C6E9A89936B8C143

View file

@ -1438,7 +1438,7 @@ impl Codegen {
E::Ident { id, .. } if ident::is_null(id) => Some(Value::ty(id.into())),
E::Ident { id, .. }
if let Some((var_index, var)) =
self.ci.vars.iter_mut().enumerate().find(|(_, v)| v.id == id) =>
self.ci.vars.iter_mut().enumerate().rfind(|(_, v)| v.id == id) =>
{
let loc = var.value.loc.as_ref();
Some(Value { ty: self.ci.vars[var_index].value.ty, loc })