Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rename error which caused clvm ops and callables to be renamed #35

Merged
merged 3 commits into from
Sep 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/compiler/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,18 @@ fn rename_in_bodyform(
},

BodyForm::Call(l, vs, tail) => {
let new_vs = map_m(
let mut new_vs = map_m(
&|x: &Rc<BodyForm>| -> Result<Rc<BodyForm>, CompileErr> {
Ok(Rc::new(rename_in_bodyform(namemap, x.clone())?))
},
vs,
)?;
// Ensure that we haven't renamed the 0th element of a call
// They exist in a separate (global) namespace of callables
// and aren't in the variable scope stack.
if !vs.is_empty() {
new_vs[0] = vs[0].clone();
}
let new_tail = if let Some(t) = tail.as_ref() {
Some(Rc::new(rename_in_bodyform(namemap, t.clone())?))
} else {
Expand Down
Loading