Skip to content

lvalue references into fields of ValPair locals #139

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

Merged
merged 5 commits into from
Feb 10, 2017

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Feb 10, 2017

I ran this on the rustc test suite and found no regressions, but your changes also came in there (and reduced the number of errors significantly), so maybe I don't see something.

more groundwork towards

src/value.rs:99: expected ptr and vtable, got ByVal(Ptr(Pointer { alloc_id: AllocId(6), offset: 0 }))

let mut allocs = Vec::new();
let mut msg = format!("{:?}", local);
let last_frame = self.stack.len() - 1;
if frame != last_frame {
write!(msg, " ({} frames up)", last_frame - frame).unwrap();
}
if let Some(field) = field {
write!(msg, " (field {:?})", field).unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

Can you print it like {local}.{field}, e.g. _42.1: Bytes(13)?

return Ok(base);
},
Value::ByValPair(_, _) => {
assert!(field_index < 2);
Copy link
Member

Choose a reason for hiding this comment

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

How do we know this won't be hit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We most likely can hit it with zst fields, but right now we don't create any ByValPairs for custom structs.

@@ -1367,13 +1367,13 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> {
if let Lvalue::Local { frame, local, field } = lvalue {
let mut allocs = Vec::new();
let mut msg = format!("{:?}", local);
if let Some(field) = field {
write!(msg, ".{}", field).unwrap();
Copy link
Member

Choose a reason for hiding this comment

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

This failed to compile, and the error message makes me realize it should only be printing the index part of the field tuple.

@solson solson merged commit 98d28b6 into rust-lang:master Feb 10, 2017
erickt pushed a commit to erickt/miri that referenced this pull request Feb 4, 2022
Update the README for the hashbrown-based implementation
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.

2 participants