mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
panic for not process-unique hash seed
This commit is contained in:
@@ -163,6 +163,16 @@ impl VirtualMachine {
|
||||
recursion_depth: Cell::new(0),
|
||||
};
|
||||
|
||||
if vm.state.hash_secret.hash_str("")
|
||||
!= vm
|
||||
.ctx
|
||||
.interned_str("")
|
||||
.expect("empty str must be interned")
|
||||
.hash(&vm)
|
||||
{
|
||||
panic!("Interpreters in same process must share the hash seed");
|
||||
}
|
||||
|
||||
let frozen = frozen::get_module_inits().collect();
|
||||
PyRc::get_mut(&mut vm.state).unwrap().frozen = frozen;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user