Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement DictSquashUpdatePtr #420

Merged
merged 21 commits into from
Jun 17, 2024
Merged

Implement DictSquashUpdatePtr #420

merged 21 commits into from
Jun 17, 2024

Conversation

har777
Copy link
Contributor

@har777 har777 commented May 20, 2024

Fixes #293

Copy link

sweep-ai bot commented May 20, 2024

Sweep: PR Review

pkg/hintrunner/hinter/zero_dict.go

New methods SetFreeOffset were added to both ZeroDictionary and ZeroDictionaryManager to allow direct setting of the freeOffset field.


pkg/hintrunner/zero/hintcode.go

A new constant string dictSquashUpdatePtrCode was added to update the current_ptr of the DictTracker to the end address of the squashed dictionary.

Sweep Found These Issues

  • The new code does not handle the case where __dict_manager.get_tracker(ids.squashed_dict_start) returns None, which could lead to a NoneType attribute error.
  • dictSquashUpdatePtrCode string = "# Update the DictTracker's current_ptr to point to the end of the squashed dict.\n__dict_manager.get_tracker(ids.squashed_dict_start).current_ptr = \\\n ids.squashed_dict_end.address_"

    View Diff


pkg/hintrunner/zero/zerohint.go

The changes add support for the dictSquashUpdatePtrCode hint type in the GetHintFromCode function by introducing a new case and its corresponding hinter creation function call.


pkg/hintrunner/zero/zerohint_dictionaries.go

Added functions to create and handle a new hint "DictSquashUpdatePtrCode" for updating the current_ptr of a DictTracker.

Sweep Found These Issues


pkg/hintrunner/hinter/zero_dict.go Outdated Show resolved Hide resolved
pkg/hintrunner/hinter/zero_dict.go Show resolved Hide resolved
@har777 har777 marked this pull request as ready for review May 21, 2024 10:18
pkg/hintrunner/zero/hintcode.go Show resolved Hide resolved
pkg/hintrunner/zero/zerohint.go Show resolved Hide resolved
pkg/hintrunner/zero/zerohint_dictionaries.go Outdated Show resolved Hide resolved
pkg/hintrunner/zero/zerohint_dictionaries.go Outdated Show resolved Hide resolved
Copy link
Contributor

@TAdev0 TAdev0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@TAdev0
Copy link
Contributor

TAdev0 commented Jun 11, 2024

@har777 you have a conflict, can you resolve it?

@har777
Copy link
Contributor Author

har777 commented Jun 11, 2024

@har777 you have a conflict, can you resolve it?

Done!

@har777 har777 merged commit 8cf54a1 into main Jun 17, 2024
4 checks passed
@har777 har777 deleted the dictsquashupdateptr_hint branch June 17, 2024 13:07
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.

DictSquashUpdatePtr
4 participants