-
Notifications
You must be signed in to change notification settings - Fork 251
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
Add range checks for bf tests #473
Comments
nuald
referenced
this issue
Oct 18, 2023
* Update the Rust's brainfuck implementation More idiomatic code, and formatting with `rustfmt`. The most important change was in the `Tape` impl: * `mov()` reallocs only once per call; * `get()` and `inc()` uses unchecked indexing because the check is already done in `mov()` * Pass String as reference * Use more specific enum variants Because of the strong typing, the `mov()` was doing many lossy casts which the C and C++ versions don't; the D version uses specific variants too. Besides, the value was always -1 or 1, so it is more idiomatic this way.
Related: #290. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The original implementation (the mirror in https://gitlab.com/nuald-grp/bf-2) has the range check and properly handles the out of bound access. Some of the existing tests don't have it, thus may have the unfair advantage because of it.
The text was updated successfully, but these errors were encountered: