Restrict global and function references to memory size
This commit is contained in:
@@ -12,10 +12,10 @@ func randOperand(t vm.OperandNumericType) *vm.Operand {
|
||||
|
||||
switch op.Type {
|
||||
case vm.GlobalMemoryIndex:
|
||||
op.Value = RandBiasedUint64()
|
||||
op.Value = RandBiasedUint64n(vm.GlobalMemorySize)
|
||||
|
||||
case vm.FunctionMemoryIndex:
|
||||
op.Value = RandBiasedUint64()
|
||||
op.Value = RandBiasedUint64n(vm.FunctionMemorySize)
|
||||
|
||||
case vm.Literal:
|
||||
switch t {
|
||||
|
||||
Reference in New Issue
Block a user