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

fix static mut dealloc or freeze #121

Merged
merged 5 commits into from
Feb 8, 2017
Merged

fix static mut dealloc or freeze #121

merged 5 commits into from
Feb 8, 2017

Conversation

oli-obk
Copy link
Contributor

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

fixes #90
fixes #118
fixes #120

Copy link
Member

@bjorn3 bjorn3 left a comment

Choose a reason for hiding this comment

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

There are a few wrong / outdated comments and strings.

src/error.rs Outdated
@@ -118,9 +118,9 @@ impl<'tcx> Error for EvalError<'tcx> {
"cannot evaluate inline assembly",
EvalError::TypeNotPrimitive(_) =>
"expected primitive type, got nonprimitive",
EvalError::ReallocatedFrozenMemory =>
EvalError::ReallocatedStaticMemory =>
"tried to reallocate frozen memory",
Copy link
Member

Choose a reason for hiding this comment

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

"static memory"?

src/memory.rs Outdated
@@ -38,9 +38,19 @@ pub struct Allocation {
/// The alignment of the allocation to detect unaligned reads.
pub align: u64,
/// Whether the allocation may be modified.
/// Use the `freeze` method of `Memory` to ensure that an error occurs, if the memory of this
/// Use the `mark_static` method of `Memory` to ensure that an error occurs, if the memory of this
/// allocation is modified in the future.
Copy link
Member

Choose a reason for hiding this comment

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

"(modified) or deallocated"?
Statics are no longer immutable.

src/memory.rs Outdated
let immutable = if alloc.immutable { " (immutable)" } else { "" };
let immutable = match alloc.static_kind {
StaticKind::Mutable => "(static mut)",
StaticKind::Immutable => "(immutable)",
Copy link
Member

Choose a reason for hiding this comment

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

"(static)"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like immutable, it could be a vtable or static or constant or promoted.

Copy link
Member

Choose a reason for hiding this comment

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

maybe use global mutable and global immutable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

too long imo. Also, it's just the trace debug messages ;)

Copy link
Member

Choose a reason for hiding this comment

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

These strings should start with spaces like the original.

@solson solson merged commit 4f3fc85 into rust-lang:master Feb 8, 2017
erickt pushed a commit to erickt/miri that referenced this pull request Feb 4, 2022
Test from Rust 1.32 and update rand & quickcheck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants