feat: reset the generator when generate finishes
This commit is contained in:
parent
501d667532
commit
3ff927d30a
|
@ -123,6 +123,15 @@ impl<'a> CodeGenerator<'a> {
|
||||||
|
|
||||||
program = aiken_optimize_and_intern(program);
|
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
|
program
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,6 @@ impl Blueprint<Schema> {
|
||||||
let validators: Result<Vec<_>, Error> = modules
|
let validators: Result<Vec<_>, Error> = modules
|
||||||
.validators()
|
.validators()
|
||||||
.map(|(validator, def)| {
|
.map(|(validator, def)| {
|
||||||
generator.reset();
|
|
||||||
Validator::from_checked_module(modules, generator, validator, def)
|
Validator::from_checked_module(modules, generator, validator, def)
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
|
|
Loading…
Reference in New Issue