From f8d82ebf57f84bfce7b6c502582791d29d0acf44 Mon Sep 17 00:00:00 2001 From: Gabriel Kronberger Date: Tue, 10 Sep 2024 12:59:29 +0200 Subject: [PATCH] Fix access to ematch buffer elements --- src/utils.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils.jl b/src/utils.jl index 2e03b08d..377132e5 100644 --- a/src/utils.jl +++ b/src/utils.jl @@ -36,7 +36,7 @@ function buffer_readable(g, limit, ematch_buffer) k = length(ematch_buffer) while k > limit - delimiter = ematch_buffer[k] + delimiter = ematch_buffer.v[k] @assert delimiter == 0xffffffffffffffffffffffffffffffff n = k - 1 @@ -44,19 +44,19 @@ function buffer_readable(g, limit, ematch_buffer) n_elems = 0 for i in n:-1:1 n_elems += 1 - if ematch_buffer[i] == 0xffffffffffffffffffffffffffffffff + if ematch_buffer.v[i] == 0xffffffffffffffffffffffffffffffff n_elems -= 1 next_delimiter_idx = i break end end - match_info = ematch_buffer[next_delimiter_idx + 1] + match_info = ematch_buffer.v[next_delimiter_idx + 1] id = v_pair_first(match_info) rule_idx = reinterpret(Int, v_pair_last(match_info)) rule_idx = abs(rule_idx) - bindings = @view ematch_buffer[(next_delimiter_idx + 2):n] + bindings = @view ematch_buffer.v[(next_delimiter_idx + 2):n] print("$id E-Classes: ", map(x -> reinterpret(Int, v_pair_first(x)), bindings)) print(" Nodes: ", map(x -> reinterpret(Int, v_pair_last(x)), bindings), "\n")