34 {
35 high_resolution_clock::time_point
start;
36 try {
37 memory_manager::set_memory_limits( 128*1024, 64*1024 );
39 module mod;
41 start = high_resolution_clock::now();
42 bp.parse_module( test, mod );
44 std::cout <<
"FAIL : " << e.
what() <<
"\n";
45 }
46 auto stop = high_resolution_clock::now();
47 auto duration = duration_cast<microseconds>(stop - start);
48 std::cout << "TIME : " << duration.count() << "us\n";
49
50#if 0
51 catch ( wasm_parse_exception& ex ) {
52 } catch ( wasm_interpreter_exception& ex ) {
53 } catch ( wasm_section_length_exception& ex ) {
54 } catch ( wasm_bad_alloc& ex ) {
55 } catch ( wasm_double_free& ex ) {
56 } catch ( wasm_vector_oob_exception& ex ) {
57 } catch ( wasm_memory_exception& ex ) {
58 } catch ( wasm_unsupported_import_exception& ex ) {
59 } catch ( wasm_illegal_opcode_exception& ex ) {
60 } catch ( guarded_ptr_exception& ex ) {
61 }
62#endif
63}
Used to generate a useful error report when an exception is thrown.
const char * what() const noexcept override
std::vector< uint8_t > read_wasm(const std::string &fname)
static const Reg16 bp(Operand::BP)
std::vector< uint8_t > wasm_code
@ test
Unit testing utility error code.