Just bump framestack limits. (#50)

These limits seems to be picked arbitrary, and I just made it arbitrary larger.

We need to reconsider these limits, ideally providing to user a way to customize the limits.

FWIW, When the last time I've tried to run gcc's torture testsuite with wasmi it also bumped into this limit.

Fixes #41.
This commit is contained in:
Sergey Pepyakin 2018-02-13 09:29:04 +03:00 committed by Nikolay Volf
parent 31a70aaa8d
commit e273b9e40a
3 changed files with 8 additions and 8 deletions

View File

@ -6,10 +6,6 @@ pub mod stack;
pub const DEFAULT_MEMORY_INDEX: u32 = 0;
/// Index of default table.
pub const DEFAULT_TABLE_INDEX: u32 = 0;
/// Maximum number of entries in value stack.
pub const DEFAULT_VALUE_STACK_LIMIT: usize = 16384;
/// Maximum number of entries in frame stack.
pub const DEFAULT_FRAME_STACK_LIMIT: usize = 1024;
/// Control stack frame.
#[derive(Debug, Clone)]

View File

@ -15,9 +15,13 @@ use value::{
use host::Externals;
use common::{DEFAULT_MEMORY_INDEX, DEFAULT_TABLE_INDEX, BlockFrame, BlockFrameType};
use common::stack::StackWithLimit;
use common::{DEFAULT_FRAME_STACK_LIMIT, DEFAULT_VALUE_STACK_LIMIT};
use memory_units::Pages;
/// Maximum number of entries in value stack.
pub const DEFAULT_VALUE_STACK_LIMIT: usize = 16384;
/// Maximum number of entries in frame stack.
pub const DEFAULT_FRAME_STACK_LIMIT: usize = 16384;
/// Function interpreter.
pub struct Interpreter<'a, E: Externals + 'a> {
externals: &'a mut E,

View File

@ -10,10 +10,10 @@ use validation::Error;
use common::stack::StackWithLimit;
use common::{BlockFrame, BlockFrameType};
/// Maximum number of entries in value stack.
/// Maximum number of entries in value stack per function.
const DEFAULT_VALUE_STACK_LIMIT: usize = 16384;
/// Maximum number of entries in frame stack.
const DEFAULT_FRAME_STACK_LIMIT: usize = 1024;
/// Maximum number of entries in frame stack per function.
const DEFAULT_FRAME_STACK_LIMIT: usize = 16384;
/// Function validation context.
struct FunctionValidationContext<'a> {