-
Notifications
You must be signed in to change notification settings - Fork 353
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
Conversation
There was a problem hiding this 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", |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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)", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"(static)"
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 ;)
There was a problem hiding this comment.
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.
Test from Rust 1.32 and update rand & quickcheck
fixes #90
fixes #118
fixes #120