From c3919daa66bdff2857e396f5d2dc61a287570080 Mon Sep 17 00:00:00 2001 From: greg Date: Thu, 7 Dec 2017 11:22:59 -0800 Subject: [PATCH] Fix pointer alias problem --- src/rukka_lang/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rukka_lang/mod.rs b/src/rukka_lang/mod.rs index d92d9dc..1814a86 100644 --- a/src/rukka_lang/mod.rs +++ b/src/rukka_lang/mod.rs @@ -207,8 +207,9 @@ fn parse_sexp(tokens: &mut Peekable>) -> Result { _ => unreachable!() }; - //let new_ptr: &Sexp = match cell_ptr { &mut Cons(_, ref cdr) => cdr, _ => unreachable!() } as &Sexp; - //cell_ptr = new_ptr; + let old_ptr = cell_ptr; + let new_ptr: &mut Sexp = match old_ptr { &mut Cons(_, ref mut cdr) => cdr, _ => unreachable!() } as &mut Sexp; + cell_ptr = new_ptr; } } }