Skip to content

Commit ead0b94

Browse files
committed
fix(rust): snapshot format 3, so a state saved by 0.1.2 or earlier is refused instead of misread
Program strings now come after the image's (Strings::fresh), so a state from an earlier build can decode a string id as a different string while its build id still matches. The format bump changes the build id too.
1 parent 5bdc5f1 commit ead0b94

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎rust/crates/psychoscript/src/snapshot.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use crate::vm::{
3030
use crate::{DiagnosticKind, Json, Limits};
3131

3232
/// Bumped whenever the shape of saved state changes.
33-
pub const FORMAT: u64 = 2;
33+
pub const FORMAT: u64 = 3;
3434

3535
/// A run's saved state: plain JSON, with a `header` that says where it can resume. A state changed since it was saved
3636
/// is refused, by a hash of it in the header; the hash guards against damage, not forgery, so resume only states your

0 commit comments

Comments
 (0)