Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
YottaChain
YTBP
提交
f394acdd
Y
YTBP
项目概览
YottaChain
/
YTBP
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Y
YTBP
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f394acdd
编写于
4月 30, 2018
作者:
K
Kevin Heifner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove already moved *_wasts.hpp
上级
3120907a
变更
2
展开全部
隐藏空白更改
内联
并排
Showing
2 changed file
with
0 addition
and
22308 deletion
+0
-22308
tests/wasm_tests/test_softfloat_wasts.hpp
tests/wasm_tests/test_softfloat_wasts.hpp
+0
-21684
tests/wasm_tests/test_wasts.hpp
tests/wasm_tests/test_wasts.hpp
+0
-624
未找到文件。
tests/wasm_tests/test_softfloat_wasts.hpp
已删除
100644 → 0
浏览文件 @
3120907a
此差异已折叠。
点击以展开。
tests/wasm_tests/test_wasts.hpp
已删除
100644 → 0
浏览文件 @
3120907a
#pragma once
#include <eosio/chain/webassembly/common.hpp>
// These are handcrafted or otherwise tricky to generate with our tool chain
static
const
char
call_depth_almost_limit_wast
[]
=
R"=====(
(module
(type (;0;) (func (param i64)))
(import "env" "printi" (func $printi (type 0)))
(table 0 anyfunc)
(memory $0 1)
(export "memory" (memory $0))
(export "_foo" (func $_foo))
(export "apply" (func $apply))
(func $_foo (param $0 i32)
(block $label$0
(br_if $label$0
(i32.eqz
(get_local $0)
)
)
(call $_foo
(i32.add
(get_local $0)
(i32.const -1)
)
)
)
)
(func $apply (param $a i64) (param $b i64) (param $c i64)
(call $_foo
(i32.const 249)
)
)
)
)====="
;
static
const
char
call_depth_limit_wast
[]
=
R"=====(
(module
(type (;0;) (func (param i64)))
(import "env" "printi" (func $printi (type 0)))
(table 0 anyfunc)
(memory $0 1)
(export "memory" (memory $0))
(export "_foo" (func $_foo))
(export "apply" (func $apply))
(func $_foo (param $0 i32)
(block $label$0
(br_if $label$0
(i32.eqz
(get_local $0)
)
)
(call $_foo
(i32.add
(get_local $0)
(i32.const -1)
)
)
)
)
(func $apply (param $a i64) (param $b i64) (param $c i64)
(call $_foo
(i32.const 250)
)
)
)
)====="
;
static
const
char
aligned_ref_wast
[]
=
R"=====(
(module
(import "env" "sha256" (func $sha256 (param i32 i32 i32)))
(table 0 anyfunc)
(memory $0 32)
(data (i32.const 4) "hello")
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(call $sha256
(i32.const 4)
(i32.const 5)
(i32.const 16)
)
)
)
)====="
;
static
const
char
aligned_ptr_wast
[]
=
R"=====(
(module
(import "env" "diveq_i128" (func $diveq_i128 (param i32 i32)))
(table 0 anyfunc)
(memory $0 32)
(data (i32.const 16) "random stuff")
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(call $diveq_i128
(i32.const 16)
(i32.const 16)
)
)
)
)====="
;
static
const
char
aligned_const_ref_wast
[]
=
R"=====(
(module
(import "env" "sha256" (func $sha256 (param i32 i32 i32)))
(import "env" "assert_sha256" (func $assert_sha256 (param i32 i32 i32)))
(table 0 anyfunc)
(memory $0 32)
(data (i32.const 4) "hello")
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(local $3 i32)
(call $sha256
(i32.const 4)
(i32.const 5)
(i32.const 16)
)
(call $assert_sha256
(i32.const 4)
(i32.const 5)
(i32.const 16)
)
)
)
)====="
;
static
const
char
misaligned_ptr_wast
[]
=
R"=====(
(module
(import "env" "diveq_i128" (func $diveq_i128 (param i32 i32)))
(table 0 anyfunc)
(memory $0 32)
(data (i32.const 16) "random stuff")
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(call $diveq_i128
(i32.const 17)
(i32.const 16)
)
)
)
)====="
;
static
const
char
misaligned_const_ptr_wast
[]
=
R"=====(
(module
(import "env" "diveq_i128" (func $diveq_i128 (param i32 i32)))
(table 0 anyfunc)
(memory $0 32)
(data (i32.const 16) "random stuff")
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(call $diveq_i128
(i32.const 16)
(i32.const 17)
)
)
)
)====="
;
static
const
char
misaligned_ref_wast
[]
=
R"=====(
(module
(import "env" "sha256" (func $sha256 (param i32 i32 i32)))
(table 0 anyfunc)
(memory $0 32)
(data (i32.const 4) "hello")
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(call $sha256
(i32.const 4)
(i32.const 5)
(i32.const 5)
)
)
)
)====="
;
static
const
char
misaligned_const_ref_wast
[]
=
R"=====(
(module
(import "env" "sha256" (func $sha256 (param i32 i32 i32)))
(import "env" "assert_sha256" (func $assert_sha256 (param i32 i32 i32)))
(import "env" "memcpy" (func $memcpy (param i32 i32 i32) (result i32)))
(table 0 anyfunc)
(memory $0 32)
(data (i32.const 4) "hello")
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(local $3 i32)
(call $sha256
(i32.const 4)
(i32.const 5)
(i32.const 16)
)
(set_local $3
(call $memcpy
(i32.const 17)
(i32.const 16)
(i32.const 64)
)
)
(call $assert_sha256
(i32.const 4)
(i32.const 5)
(i32.const 17)
)
)
)
)====="
;
static
const
char
entry_wast
[]
=
R"=====(
(module
(import "env" "eosio_assert" (func $eosio_assert (param i32 i32)))
(import "env" "now" (func $now (result i32)))
(table 0 anyfunc)
(memory $0 1)
(export "memory" (memory $0))
(export "entry" (func $entry))
(export "apply" (func $apply))
(func $entry
(block
(i32.store offset=4
(i32.const 0)
(call $now)
)
)
)
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(block
(call $eosio_assert
(i32.eq
(i32.load offset=4
(i32.const 0)
)
(call $now)
)
(i32.const 0)
)
)
)
(start $entry)
)
)====="
;
static
const
char
simple_no_memory_wast
[]
=
R"=====(
(module
(import "env" "require_auth" (func $require_auth (param i64)))
(import "env" "memcpy" (func $memcpy (param i32 i32 i32) (result i32)))
(table 0 anyfunc)
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(call $require_auth (i64.const 11323361180581363712))
(drop
(call $memcpy
(i32.const 0)
(i32.const 1024)
(i32.const 1024)
)
)
)
)
)====="
;
static
const
char
mutable_global_wast
[]
=
R"=====(
(module
(import "env" "require_auth" (func $require_auth (param i64)))
(import "env" "eosio_assert" (func $eosio_assert (param i32 i32)))
(table 0 anyfunc)
(memory $0 1)
(export "memory" (memory $0))
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(call $require_auth (i64.const 7235159549794234880))
(if (i64.eq (get_local $2) (i64.const 0)) (then
(set_global $g0 (i64.const 444))
(return)
))
(if (i64.eq (get_local $2) (i64.const 1)) (then
(call $eosio_assert (i64.eq (get_global $g0) (i64.const 2)) (i32.const 0))
(return)
))
(call $eosio_assert (i32.const 0) (i32.const 0))
)
(global $g0 (mut i64) (i64.const 2))
)
)====="
;
static
const
char
biggest_memory_wast
[]
=
R"=====(
(module
(import "env" "eosio_assert" (func $$eosio_assert (param i32 i32)))
(import "env" "require_auth" (func $$require_auth (param i64)))
(table 0 anyfunc)
(memory $$0 ${MAX_WASM_PAGES})
(export "memory" (memory $$0))
(export "apply" (func $$apply))
(func $$apply (param $$0 i64) (param $$1 i64) (param $$2 i64)
(call $$require_auth (i64.const 4294504710842351616))
(call $$eosio_assert
(i32.eq
(grow_memory (i32.const 1))
(i32.const -1)
)
(i32.const 0)
)
)
)
)====="
;
static
const
char
too_big_memory_wast
[]
=
R"=====(
(module
(table 0 anyfunc)
(memory $$0 ${MAX_WASM_PAGES_PLUS_ONE})
(export "memory" (memory $$0))
(export "apply" (func $$apply))
(func $$apply (param $$0 i64) (param $$1 i64) (param $$2 i64))
)
)====="
;
static
const
char
valid_sparse_table
[]
=
R"=====(
(module
(table 1024 anyfunc)
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64))
(elem (i32.const 0) $apply)
(elem (i32.const 1022) $apply $apply)
)
)====="
;
static
const
char
too_big_table
[]
=
R"=====(
(module
(table 1025 anyfunc)
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64))
(elem (i32.const 0) $apply)
(elem (i32.const 1022) $apply $apply)
)
)====="
;
static
const
char
memory_init_borderline
[]
=
R"=====(
(module
(memory $0 16)
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64))
(data (i32.const 65532) "sup!")
)
)====="
;
static
const
char
memory_init_toolong
[]
=
R"=====(
(module
(memory $0 16)
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64))
(data (i32.const 65533) "sup!")
)
)====="
;
static
const
char
memory_init_negative
[]
=
R"=====(
(module
(memory $0 16)
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64))
(data (i32.const -1) "sup!")
)
)====="
;
static
const
char
memory_table_import
[]
=
R"=====(
(module
(table (import "foo" "table") 10 anyfunc)
(memory (import "nom" "memory") 0)
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64))
)
)====="
;
static
const
char
table_checker_wast
[]
=
R"=====(
(module
(import "env" "require_auth" (func $require_auth (param i64)))
(import "env" "eosio_assert" (func $assert (param i32 i32)))
(type $SIG$vj (func (param i64)))
(table 1024 anyfunc)
(memory $0 1)
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(call $require_auth (i64.const 14547189746360123392))
(call_indirect $SIG$vj
(i64.shr_u
(get_local $2)
(i64.const 32)
)
(i32.wrap/i64
(get_local $2)
)
)
)
(func $apple (type $SIG$vj) (param $0 i64)
(call $assert
(i64.eq
(get_local $0)
(i64.const 555)
)
(i32.const 0)
)
)
(func $bannna (type $SIG$vj) (param $0 i64)
(call $assert
(i64.eq
(get_local $0)
(i64.const 7777)
)
(i32.const 0)
)
)
(elem (i32.const 0) $apple)
(elem (i32.const 1022) $apple $bannna)
)
)====="
;
static
const
char
table_checker_proper_syntax_wast
[]
=
R"=====(
(module
(import "env" "require_auth" (func $require_auth (param i64)))
(import "env" "eosio_assert" (func $assert (param i32 i32)))
(import "env" "printi" (func $printi (param i64)))
(type $SIG$vj (func (param i64)))
(table 1024 anyfunc)
(memory $0 1)
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(call $require_auth (i64.const 14547189746360123392))
(call_indirect (type $SIG$vj)
(i64.shr_u
(get_local $2)
(i64.const 32)
)
(i32.wrap/i64
(get_local $2)
)
)
)
(func $apple (type $SIG$vj) (param $0 i64)
(call $assert
(i64.eq
(get_local $0)
(i64.const 555)
)
(i32.const 0)
)
)
(func $bannna (type $SIG$vj) (param $0 i64)
(call $assert
(i64.eq
(get_local $0)
(i64.const 7777)
)
(i32.const 0)
)
)
(elem (i32.const 0) $apple)
(elem (i32.const 1022) $apple $bannna)
)
)====="
;
static
const
char
table_checker_small_wast
[]
=
R"=====(
(module
(import "env" "require_auth" (func $require_auth (param i64)))
(import "env" "eosio_assert" (func $assert (param i32 i32)))
(import "env" "printi" (func $printi (param i64)))
(type $SIG$vj (func (param i64)))
(table 128 anyfunc)
(memory $0 1)
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(call $require_auth (i64.const 14547189746360123392))
(call_indirect (type $SIG$vj)
(i64.shr_u
(get_local $2)
(i64.const 32)
)
(i32.wrap/i64
(get_local $2)
)
)
)
(func $apple (type $SIG$vj) (param $0 i64)
(call $assert
(i64.eq
(get_local $0)
(i64.const 555)
)
(i32.const 0)
)
)
(elem (i32.const 0) $apple)
)
)====="
;
static
const
char
global_protection_none_get_wast
[]
=
R"=====(
(module
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(drop (get_global 0))
)
)
)====="
;
static
const
char
global_protection_some_get_wast
[]
=
R"=====(
(module
(global i32 (i32.const -11))
(global i32 (i32.const 56))
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(drop (get_global 1))
(drop (get_global 2))
)
)
)====="
;
static
const
char
global_protection_none_set_wast
[]
=
R"=====(
(module
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(set_global 0 (get_local 1))
)
)
)====="
;
static
const
char
global_protection_some_set_wast
[]
=
R"=====(
(module
(global i64 (i64.const -11))
(global i64 (i64.const 56))
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 i64) (param $2 i64)
(set_global 2 (get_local 1))
)
)
)====="
;
static
const
std
::
vector
<
uint8_t
>
global_protection_okay_get_wasm
{
0x00
,
'a'
,
's'
,
'm'
,
0x01
,
0x00
,
0x00
,
0x00
,
0x01
,
0x07
,
0x01
,
0x60
,
0x03
,
0x7e
,
0x7e
,
0x7e
,
0x00
,
//type section containing a function as void(i64,i64,i64)
0x03
,
0x02
,
0x01
,
0x00
,
//a function
0x06
,
0x06
,
0x01
,
0x7f
,
0x00
,
0x41
,
0x75
,
0x0b
,
//global
0x07
,
0x09
,
0x01
,
0x05
,
'a'
,
'p'
,
'p'
,
'l'
,
'y'
,
0x00
,
0x00
,
//export function 0 as "apply"
0x0a
,
0x07
,
0x01
,
//code section
0x05
,
0x00
,
//function body start with length 5; no locals
0x23
,
0x00
,
//get global 0
0x1a
,
//drop
0x0b
//end
};
static
const
std
::
vector
<
uint8_t
>
global_protection_none_get_wasm
{
0x00
,
'a'
,
's'
,
'm'
,
0x01
,
0x00
,
0x00
,
0x00
,
0x01
,
0x07
,
0x01
,
0x60
,
0x03
,
0x7e
,
0x7e
,
0x7e
,
0x00
,
//type section containing a function as void(i64,i64,i64)
0x03
,
0x02
,
0x01
,
0x00
,
//a function
0x07
,
0x09
,
0x01
,
0x05
,
'a'
,
'p'
,
'p'
,
'l'
,
'y'
,
0x00
,
0x00
,
//export function 0 as "apply"
0x0a
,
0x07
,
0x01
,
//code section
0x05
,
0x00
,
//function body start with length 5; no locals
0x23
,
0x00
,
//get global 0
0x1a
,
//drop
0x0b
//end
};
static
const
std
::
vector
<
uint8_t
>
global_protection_some_get_wasm
{
0x00
,
'a'
,
's'
,
'm'
,
0x01
,
0x00
,
0x00
,
0x00
,
0x01
,
0x07
,
0x01
,
0x60
,
0x03
,
0x7e
,
0x7e
,
0x7e
,
0x00
,
//type section containing a function as void(i64,i64,i64)
0x03
,
0x02
,
0x01
,
0x00
,
//a function
0x06
,
0x06
,
0x01
,
0x7f
,
0x00
,
0x41
,
0x75
,
0x0b
,
//global
0x07
,
0x09
,
0x01
,
0x05
,
'a'
,
'p'
,
'p'
,
'l'
,
'y'
,
0x00
,
0x00
,
//export function 0 as "apply"
0x0a
,
0x07
,
0x01
,
//code section
0x05
,
0x00
,
//function body start with length 5; no locals
0x23
,
0x01
,
//get global 1
0x1a
,
//drop
0x0b
//end
};
static
const
std
::
vector
<
uint8_t
>
global_protection_okay_set_wasm
{
0x00
,
'a'
,
's'
,
'm'
,
0x01
,
0x00
,
0x00
,
0x00
,
0x01
,
0x07
,
0x01
,
0x60
,
0x03
,
0x7e
,
0x7e
,
0x7e
,
0x00
,
//type section containing a function as void(i64,i64,i64)
0x03
,
0x02
,
0x01
,
0x00
,
//a function
0x06
,
0x06
,
0x01
,
0x7e
,
0x01
,
0x42
,
0x75
,
0x0b
,
//global.. this time with i64 & global mutablity
0x07
,
0x09
,
0x01
,
0x05
,
'a'
,
'p'
,
'p'
,
'l'
,
'y'
,
0x00
,
0x00
,
//export function 0 as "apply"
0x0a
,
0x08
,
0x01
,
//code section
0x06
,
0x00
,
//function body start with length 6; no locals
0x20
,
0x00
,
//get local 0
0x24
,
0x00
,
//set global 0
0x0b
//end
};
static
const
std
::
vector
<
uint8_t
>
global_protection_some_set_wasm
{
0x00
,
'a'
,
's'
,
'm'
,
0x01
,
0x00
,
0x00
,
0x00
,
0x01
,
0x07
,
0x01
,
0x60
,
0x03
,
0x7e
,
0x7e
,
0x7e
,
0x00
,
//type section containing a function as void(i64,i64,i64)
0x03
,
0x02
,
0x01
,
0x00
,
//a function
0x06
,
0x06
,
0x01
,
0x7e
,
0x01
,
0x42
,
0x75
,
0x0b
,
//global.. this time with i64 & global mutablity
0x07
,
0x09
,
0x01
,
0x05
,
'a'
,
'p'
,
'p'
,
'l'
,
'y'
,
0x00
,
0x00
,
//export function 0 as "apply"
0x0a
,
0x08
,
0x01
,
//code section
0x06
,
0x00
,
//function body start with length 6; no locals
0x20
,
0x00
,
//get local 0
0x24
,
0x01
,
//set global 1
0x0b
//end
};
static
const
char
no_apply_wast
[]
=
R"=====(
(module
(func $apply (param $0 i64) (param $1 i64) (param $2 i64))
)
)====="
;
static
const
char
apply_wrong_signature_wast
[]
=
R"=====(
(module
(export "apply" (func $apply))
(func $apply (param $0 i64) (param $1 f64))
)
)====="
;
static
const
char
import_injected_wast
[]
=
\
"(module"
\
" (export
\"
apply
\"
(func $apply))"
\
" (import
\"
"
EOSIO_INJECTED_MODULE_NAME
"
\"
\"
checktime
\"
(func $inj (param i32)))"
\
" (func $apply (param $0 i64) (param $1 i64) (param $2 i64))"
\
")"
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录