mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-09 06:08:29 +00:00
Only check memory bounds for dynamic memory plans.
This commit is contained in:
@@ -22,7 +22,7 @@ use wasmer_compiler::{
|
|||||||
TrapInformation,
|
TrapInformation,
|
||||||
};
|
};
|
||||||
use wasmer_runtime::{
|
use wasmer_runtime::{
|
||||||
MemoryPlan, ModuleInfo, TablePlan, TrapCode, VMBuiltinFunctionIndex, VMOffsets,
|
MemoryPlan, MemoryStyle, ModuleInfo, TablePlan, TrapCode, VMBuiltinFunctionIndex, VMOffsets,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// The singlepass per-function code generator.
|
/// The singlepass per-function code generator.
|
||||||
@@ -38,7 +38,7 @@ pub struct FuncGen<'a> {
|
|||||||
vmoffsets: &'a VMOffsets,
|
vmoffsets: &'a VMOffsets,
|
||||||
|
|
||||||
// // Memory plans.
|
// // Memory plans.
|
||||||
// memory_plans: &'a PrimaryMap<MemoryIndex, MemoryPlan>,
|
memory_plans: &'a PrimaryMap<MemoryIndex, MemoryPlan>,
|
||||||
|
|
||||||
// // Table plans.
|
// // Table plans.
|
||||||
// table_plans: &'a PrimaryMap<TableIndex, TablePlan>,
|
// table_plans: &'a PrimaryMap<TableIndex, TablePlan>,
|
||||||
@@ -1214,7 +1214,10 @@ impl<'a> FuncGen<'a> {
|
|||||||
value_size: usize,
|
value_size: usize,
|
||||||
cb: F,
|
cb: F,
|
||||||
) -> Result<(), CodegenError> {
|
) -> Result<(), CodegenError> {
|
||||||
let need_check = true;
|
let need_check = match self.memory_plans[MemoryIndex::new(0)].style {
|
||||||
|
MemoryStyle::Static { .. } => false,
|
||||||
|
MemoryStyle::Dynamic => true,
|
||||||
|
};
|
||||||
let tmp_addr = self.machine.acquire_temp_gpr().unwrap();
|
let tmp_addr = self.machine.acquire_temp_gpr().unwrap();
|
||||||
let tmp_base = self.machine.acquire_temp_gpr().unwrap();
|
let tmp_base = self.machine.acquire_temp_gpr().unwrap();
|
||||||
|
|
||||||
@@ -1769,7 +1772,7 @@ impl<'a> FuncGen<'a> {
|
|||||||
module: &'a ModuleInfo,
|
module: &'a ModuleInfo,
|
||||||
config: &'a SinglepassConfig,
|
config: &'a SinglepassConfig,
|
||||||
vmoffsets: &'a VMOffsets,
|
vmoffsets: &'a VMOffsets,
|
||||||
_memory_plans: &'a PrimaryMap<MemoryIndex, MemoryPlan>,
|
memory_plans: &'a PrimaryMap<MemoryIndex, MemoryPlan>,
|
||||||
_table_plans: &'a PrimaryMap<TableIndex, TablePlan>,
|
_table_plans: &'a PrimaryMap<TableIndex, TablePlan>,
|
||||||
local_func_index: LocalFunctionIndex,
|
local_func_index: LocalFunctionIndex,
|
||||||
local_types_excluding_arguments: &[WpType],
|
local_types_excluding_arguments: &[WpType],
|
||||||
@@ -1798,7 +1801,7 @@ impl<'a> FuncGen<'a> {
|
|||||||
module,
|
module,
|
||||||
config,
|
config,
|
||||||
vmoffsets,
|
vmoffsets,
|
||||||
// memory_plans,
|
memory_plans,
|
||||||
// table_plans,
|
// table_plans,
|
||||||
signature,
|
signature,
|
||||||
assembler: Assembler::new().unwrap(),
|
assembler: Assembler::new().unwrap(),
|
||||||
|
|||||||
Reference in New Issue
Block a user