Fix index of of range

This commit is contained in:
Lee Cannon 2021-06-18 12:58:15 +01:00
parent a02c1e7996
commit c2cbc05135

View File

@ -2296,7 +2296,11 @@ fn resolveUse(
defer _ = using_trail.pop();
for (uses) |use| {
const expr = .{ .node = handle.tree.nodes.items(.data)[use.*].lhs, .handle = handle };
const index = use.*;
if (handle.tree.nodes.items(.data).len <= index) continue;
const expr = .{ .node = handle.tree.nodes.items(.data)[index].lhs, .handle = handle };
const expr_type_node = (try resolveTypeOfNode(store, arena, expr)) orelse
continue;