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

Use a mock sentinel for MARK instead of a gensym #216

Merged
merged 1 commit into from
May 29, 2023
Merged

Commits on May 29, 2023

  1. Use a mock sentinel for MARK instead of a gensym

    Gensyms just resolve to strings, and shouldn't be used literally anywhere they might collide with adversarial input, which commonly come in the form of unsanitized strings. User input could theoretically change where a MARK is, altering behavior.
    
    sentinels normally shouldn't be used outside of tests, but the standalone property limits my options. At run time a simple `object()` would do, but unpickling the same object() created at read time twice wouldn't preserve equality in this case. A sentinel can do that.
    
    I've used getattr to create a sentinel with a non-identifier string, which are almost never used, so this is unlikely to interfere with tests. For good measure, I prepended `hissp.` to the `]` as a namespace.
    gilch committed May 29, 2023
    Configuration menu
    Copy the full SHA
    3e059e2 View commit details
    Browse the repository at this point in the history