mirror of
https://github.com/fluencelabs/wasmer
synced 2025-07-30 23:02:06 +00:00
Add generic range bounds to mmap (#110)
This commit is contained in:
@@ -63,7 +63,7 @@ impl FuncResolverBuilder {
|
||||
.map_err(|e| CompileError::InternalError { msg: e.to_string() })?;
|
||||
unsafe {
|
||||
memory
|
||||
.protect(0..memory.size(), Protect::ReadWrite)
|
||||
.protect(.., Protect::ReadWrite)
|
||||
.map_err(|e| CompileError::InternalError { msg: e.to_string() })?;
|
||||
}
|
||||
|
||||
@@ -179,7 +179,7 @@ impl FuncResolverBuilder {
|
||||
unsafe {
|
||||
self.resolver
|
||||
.memory
|
||||
.protect(0..self.resolver.memory.size(), Protect::ReadExec)
|
||||
.protect(.., Protect::ReadExec)
|
||||
.map_err(|e| CompileError::InternalError { msg: e.to_string() })?;
|
||||
}
|
||||
|
||||
|
@@ -66,9 +66,7 @@ impl Trampolines {
|
||||
|
||||
let mut memory = Memory::with_size(total_size).unwrap();
|
||||
unsafe {
|
||||
memory
|
||||
.protect(0..memory.size(), Protect::ReadWrite)
|
||||
.unwrap();
|
||||
memory.protect(.., Protect::ReadWrite).unwrap();
|
||||
}
|
||||
|
||||
// "\xCC" disassembles to "int3", which will immediately cause
|
||||
@@ -91,7 +89,7 @@ impl Trampolines {
|
||||
}
|
||||
|
||||
unsafe {
|
||||
memory.protect(0..memory.size(), Protect::ReadExec).unwrap();
|
||||
memory.protect(.., Protect::ReadExec).unwrap();
|
||||
}
|
||||
|
||||
Self {
|
||||
|
Reference in New Issue
Block a user