diff --git a/crates/aiken-lang/src/uplc.rs b/crates/aiken-lang/src/uplc.rs index fc4fe252..5ab20fb2 100644 --- a/crates/aiken-lang/src/uplc.rs +++ b/crates/aiken-lang/src/uplc.rs @@ -123,6 +123,15 @@ impl<'a> CodeGenerator<'a> { program = aiken_optimize_and_intern(program); + // This is very important to call here. + // If this isn't done, re-using the same instance + // of the generator will result in free unique errors + // among other unpredictable things. In fact, + // switching to a shared code generator caused some + // instability issues and we fixed it by placing this + // method here. + self.reset(); + program } diff --git a/crates/aiken-project/src/blueprint/mod.rs b/crates/aiken-project/src/blueprint/mod.rs index 882899b7..0f23a14d 100644 --- a/crates/aiken-project/src/blueprint/mod.rs +++ b/crates/aiken-project/src/blueprint/mod.rs @@ -36,7 +36,6 @@ impl Blueprint { let validators: Result, Error> = modules .validators() .map(|(validator, def)| { - generator.reset(); Validator::from_checked_module(modules, generator, validator, def) }) .collect();