Skip to content

fix: tighten stack validation semantics - #18

Merged
berisher merged 1 commit into
mainfrom
fix/stack-validation-semantics
Mar 31, 2026
Merged

fix: tighten stack validation semantics#18
berisher merged 1 commit into
mainfrom
fix/stack-validation-semantics

Conversation

@berisher

Copy link
Copy Markdown
Collaborator

Summary

This PR tightens the generator's stack simulation and opcode validation so the
modeled pickle VM stays aligned with real pickle semantics.

  • preserve aliasing and object identity across memo operations and BUILD
  • reject APPEND, tuple shortcuts, and READONLY_BUFFER in invalid stack states
  • fix protocol 0/1 cleanup, proto-0/1 INT bool decoding, and LONG1/LONG4 sign extension
  • break isolated StackObjectRef cycles on drop and remove dead StackObject Hash/Eq impls
  • add focused unit coverage for the stack/validation edge cases this PR changes

Remediated Findings

  • F-0005
  • F-0040
  • F-0042
  • F-0043
  • F-0044
  • F-0045
  • F-0083
  • F-0084
  • F-0090
  • F-0091
  • F-0096

How to validate

cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo test

@berisher
berisher merged commit 4b48e77 into main Mar 31, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant