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

MIR string slices #2025

Merged
merged 1 commit into from
Jul 2, 2024
Merged

MIR string slices #2025

merged 1 commit into from
Jul 2, 2024

Conversation

RyanGlScott
Copy link
Contributor

This adds rudimentary support for constructing MIR str slice references via the new mir_str_slice_value and mir_str_slice_range_value SAWScript functions. These behave much like their cousins mir_slice_value and mir_slice_range_value (which work for array slices), except that they return something of type &str instead of, say, &[u8]. See the manual for the full details and current limitations of the approach.

The mir_str_slice_value/mir_str_slice_range_value functions mostly share the same implementation as mir_slice_value/mir_slice_range_value, except for some minor differences regarding how the underlying types are handled. There is now a new MirSliceInfo data type that signals whether we are dealing with a str slice or an array slice.

Fixes #1997.

@RyanGlScott RyanGlScott added the subsystem: crucible-mir Issues related to Rust verification with crucible-mir and/or mir-json label Feb 7, 2024
@RyanGlScott RyanGlScott requested review from sauclovian-g and removed request for eddywestbrook March 29, 2024 15:06
Copy link
Contributor

@sauclovian-g sauclovian-g left a comment

Choose a reason for hiding this comment

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

Looks plausible, not sure how much use that is as an actual review...

src/SAWScript/Crucible/MIR/Builtins.hs Show resolved Hide resolved
doc/manual/head.tex Show resolved Hide resolved
Copy link
Member

@kquick kquick left a comment

Choose a reason for hiding this comment

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

Looks fine in general, although as an outsider, I would like more information on when/why to use this (as noted in my comment). I'd also recommend getting a review from spernsteiner.

doc/manual/manual.md Show resolved Hide resolved
This adds rudimentary support for constructing MIR `str` slice references via
the new `mir_str_slice_value` and `mir_str_slice_range_value` SAWScript
functions. These behave much like their cousins `mir_slice_value` and
`mir_slice_range_value` (which work for array slices), except that they return
something of type `&str` instead of, say, `&[u8]`. See the manual for the full
details and current limitations of the approach.

The `mir_str_slice_value`/`mir_str_slice_range_value` functions mostly share
the same implementation as `mir_slice_value`/`mir_slice_range_value`, except
for some minor differences regarding how the underlying types are handled.
There is now a new `MirSliceInfo` data type that signals whether we are dealing
with a `str` slice or an array slice.

Fixes #1997.
@RyanGlScott RyanGlScott merged commit b61a0c2 into master Jul 2, 2024
34 checks passed
@RyanGlScott RyanGlScott deleted the mir-string-slices branch July 2, 2024 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subsystem: crucible-mir Issues related to Rust verification with crucible-mir and/or mir-json
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support MIR string slices
3 participants