Skip to content

Instantly share code, notes, and snippets.

@eholk
Created October 6, 2016 15:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eholk/f2748e1b0c98b4e39a56356b25e9aaea to your computer and use it in GitHub Desktop.
Save eholk/f2748e1b0c98b4e39a56356b25e9aaea to your computer and use it in GitHub Desktop.
[binaryen] FAILED with exit code Some(101)
command: "/usr/local/google/home/eholk/wasm/mir2wasm/target/debug/mir2wasm" "tests/compile-pass/iterator.rs" "-Dwarnings" "--run" "-o" "/usr/local/google/home/eholk/wasm/mir2wasm/target/debug/tests/run-compile-pass/iterator.wasm"
stdout:
stderr:
[wasm-validator error in function $main] 1 != 0: set_local type must match function, on
[none] (set_local $12
[none] (get_local $0)
)
[wasm-validator error in function $main] 1 != 0: set_local type must match function, on
[none] (set_local $13
[none] (get_local $12)
)
(module
(memory $0 1 1)
(start $__wasm_start)
(type $rustfn-0-35 (func (param i32) (result i32)))
(type $rustfn-0-43 (func (param i32) (result i32)))
(type $rustfn-0-2 (func))
(type $__wasm_start (func))
(type $rustfn-0-17 (func (param i32 i32) (result i32)))
(type $rustfn-0-57 (func (param i32 i32) (result i32)))
(export "memory" (memory $0))
(export "_ops::Range_i32__as_iter::IntoIterator_::into_iter" (func $_ops::Range_i32__as_iter::IntoIterator_::into_iter))
(export "_iter::RangeIterator_i32__as_iter::Iterator_::next" (func $_iter::RangeIterator_i32__as_iter::Iterator_::next))
(export "main" (func $main))
(export "rust_entry" (func $__wasm_start))
(export "_i32_as_ops::Add_::add" (func $_i32_as_ops::Add_::add))
(export "_i32_as_cmp::PartialEq_::eq" (func $_i32_as_cmp::PartialEq_::eq))
(export "_i32_as_cmp::PartialEq_::ne" (func $_i32_as_cmp::PartialEq_::ne))
(func $_ops::Range_i32__as_iter::IntoIterator_::into_iter (type $rustfn-0-35) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i64)
(block $block$1$break
(set_local $5
(i32.load
(i32.const 0)
)
)
(block
(br $block$1$break)
)
)
(block
(block $block$2$break
(block $bb0
(set_local $1
(get_local $0)
)
(set_local $2
(i32.load
(get_local $1)
)
)
(set_local $3
(i32.load offset=4
(get_local $1)
)
)
(i32.store
(i32.const 0)
(tee_local $4
(i32.sub
(i32.load
(i32.const 0)
)
(i32.const 64)
)
)
)
(i32.store
(i32.load
(i32.const 0)
)
(get_local $2)
)
(i32.store offset=4
(i32.load
(i32.const 0)
)
(get_local $3)
)
)
(block
(br $block$2$break)
)
)
(block
(block $bb1
(i32.store
(i32.const 0)
(get_local $5)
)
(return
(get_local $4)
)
)
)
)
)
(func $_iter::RangeIterator_i32__as_iter::Iterator_::next (type $rustfn-0-43) (param $0 i32) (result i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $9 i32)
(local $10 i32)
(local $11 i32)
(local $12 i32)
(local $13 i32)
(local $14 i32)
(local $15 i32)
(local $16 i32)
(local $17 i64)
(block $block$1$break
(set_local $15
(i32.load
(i32.const 0)
)
)
(block
(br $block$1$break)
)
)
(block
(block $block$4$break
(block $bb0
(set_local $1
(get_local $0)
)
(set_local $5
(i32.load
(get_local $1)
)
)
(set_local $6
(i32.load offset=4
(get_local $1)
)
)
(set_local $4
(i32.eq
(get_local $5)
(get_local $6)
)
)
)
(if
(get_local $4)
(block
(block $bb1
(i32.store
(i32.const 0)
(tee_local $14
(i32.sub
(i32.load
(i32.const 0)
)
(i32.const 64)
)
)
)
(i32.store
(i32.load
(i32.const 0)
)
(i32.const 0)
)
)
(block
(br $block$4$break)
)
)
(block
(block $block$5$break
(block $bb2
(set_local $10
(i32.load
(get_local $1)
)
)
(set_local $2
(get_local $10)
)
(set_local $11
(i32.load
(get_local $1)
)
)
(set_local $17
(i64.add
(i64.extend_s/i32
(get_local $11)
)
(i64.extend_s/i32
(i32.const 1)
)
)
)
(i32.store
(i32.const 0)
(tee_local $12
(i32.sub
(i32.load
(i32.const 0)
)
(i32.const 64)
)
)
)
(i32.store
(get_local $12)
(i32.wrap/i64
(get_local $17)
)
)
(i32.store offset=4
(get_local $12)
(i32.wrap/i64
(i64.shr_u
(get_local $17)
(i64.const 32)
)
)
)
)
(block
(br $block$5$break)
)
)
(block
(block $bb4
(i32.store
(get_local $1)
(i32.load
(get_local $12)
)
)
(set_local $13
(get_local $2)
)
(i32.store
(i32.const 0)
(tee_local $14
(i32.sub
(i32.load
(i32.const 0)
)
(i32.const 64)
)
)
)
(i32.store
(i32.load
(i32.const 0)
)
(i32.const 1)
)
(i32.store offset=4
(i32.load
(i32.const 0)
)
(get_local $13)
)
)
(block
(br $block$4$break)
)
)
)
)
)
(block
(block $bb3
(i32.store
(i32.const 0)
(get_local $15)
)
(return
(get_local $14)
)
)
)
)
)
(func $main (type $rustfn-0-2)
(local $0 i32)
(local $1 i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $9 i32)
(local $10 i32)
(local $11 i32)
(local $12 i32)
(local $13 i32)
(local $14 i32)
(local $15 i64)
(local $16 i32)
(local $17 i32)
(block $block$1$break
(set_local $13
(i32.load
(i32.const 0)
)
)
(block
(br $block$1$break)
)
)
(block
(block $block$2$break
(block $bb0
(set_local $5
(i32.const 0)
)
(set_local $6
(i32.const 10)
)
(i32.store
(i32.const 0)
(tee_local $4
(i32.sub
(i32.load
(i32.const 0)
)
(i32.const 64)
)
)
)
(i32.store
(i32.load
(i32.const 0)
)
(get_local $5)
)
(i32.store offset=4
(i32.load
(i32.const 0)
)
(get_local $6)
)
(set_local $16
(call $_ops::Range_i32__as_iter::IntoIterator_::into_iter
(get_local $4)
)
)
(i32.store
(i32.const 0)
(tee_local $3
(i32.sub
(i32.load
(i32.const 0)
)
(i32.const 64)
)
)
)
(i64.store
(i32.load
(i32.const 0)
)
(i64.load
(get_local $16)
)
)
)
(block
(br $block$2$break)
)
)
(block
(block $block$3$break
(block $bb1
(set_local $1
(get_local $3)
)
)
(block
(br $block$3$break)
)
)
(block
(block $block$5$break
(loop $shape$3$continue
(block $block$4$break
(block $bb2
(set_local $10
(get_local $1)
)
(set_local $9
(get_local $10)
)
(set_local $17
(call $_iter::RangeIterator_i32__as_iter::Iterator_::next
(get_local $9)
)
)
(i32.store
(i32.const 0)
(tee_local $8
(i32.sub
(i32.load
(i32.const 0)
)
(i32.const 64)
)
)
)
(i64.store
(i32.load
(i32.const 0)
)
(i64.load
(get_local $17)
)
)
)
(block
(br $block$4$break)
)
)
(block
(block $block$6$break
(block $bb3
)
(block $switch$4$leave
(block $switch$4$case$6
(block $switch$4$default
(br_table $switch$4$default $switch$4$case$6 $switch$4$default
(i32.load
(get_local $8)
)
)
)
(block
(br $block$5$break)
)
(br $switch$4$leave)
)
(block
(br $block$6$break)
)
(br $switch$4$leave)
)
)
(block
(block $bb5
(set_local $2
(i32.load offset=4
(get_local $8)
)
)
)
(block
(br $shape$3$continue)
)
)
)
)
)
(block
(block $bb4
(set_local $12
(get_local $0)
)
(set_local $13
(get_local $12)
)
(i32.store
(i32.const 0)
(get_local $13)
)
(return)
)
)
)
)
)
)
(func $__wasm_start (type $__wasm_start)
(i32.store
(i32.const 0)
(i32.const 65535)
)
(call $main)
)
(func $_i32_as_ops::Add_::add (type $rustfn-0-17) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $9 i32)
(local $10 i64)
(block $block$1$break
(set_local $8
(i32.load
(i32.const 0)
)
)
(block
(br $block$1$break)
)
)
(block
(block $block$2$break
(block $bb0
(set_local $2
(get_local $0)
)
(set_local $3
(get_local $1)
)
(set_local $4
(get_local $2)
)
(set_local $5
(get_local $3)
)
(set_local $10
(i64.add
(i64.extend_s/i32
(get_local $4)
)
(i64.extend_s/i32
(get_local $5)
)
)
)
(i32.store
(i32.const 0)
(tee_local $6
(i32.sub
(i32.load
(i32.const 0)
)
(i32.const 64)
)
)
)
(i32.store
(get_local $6)
(i32.wrap/i64
(get_local $10)
)
)
(i32.store offset=4
(get_local $6)
(i32.wrap/i64
(i64.shr_u
(get_local $10)
(i64.const 32)
)
)
)
)
(block
(br $block$2$break)
)
)
(block
(block $bb1
(set_local $7
(i32.load
(get_local $6)
)
)
(i32.store
(i32.const 0)
(get_local $8)
)
(return
(get_local $7)
)
)
)
)
)
(func $_i32_as_cmp::PartialEq_::eq (type $rustfn-0-57) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $9 i64)
(block $block$1$break
(set_local $7
(i32.load
(i32.const 0)
)
)
(block
(br $block$1$break)
)
)
(block
(block $block$2$break
(block $bb0
(set_local $2
(get_local $0)
)
(set_local $3
(get_local $1)
)
(set_local $4
(get_local $2)
)
(set_local $5
(get_local $3)
)
(set_local $6
(i32.eq
(get_local $4)
(get_local $5)
)
)
)
(block
(br $block$2$break)
)
)
(block
(block $bb1
(i32.store
(i32.const 0)
(get_local $7)
)
(return
(get_local $6)
)
)
)
)
)
(func $_i32_as_cmp::PartialEq_::ne (type $rustfn-0-57) (param $0 i32) (param $1 i32) (result i32)
(local $2 i32)
(local $3 i32)
(local $4 i32)
(local $5 i32)
(local $6 i32)
(local $7 i32)
(local $8 i32)
(local $9 i64)
(block $block$1$break
(set_local $7
(i32.load
(i32.const 0)
)
)
(block
(br $block$1$break)
)
)
(block
(block $block$2$break
(block $bb0
(set_local $2
(get_local $0)
)
(set_local $3
(get_local $1)
)
(set_local $4
(get_local $2)
)
(set_local $5
(get_local $3)
)
(set_local $6
(i32.ne
(get_local $4)
(get_local $5)
)
)
)
(block
(br $block$2$break)
)
)
(block
(block $bb1
(i32.store
(i32.const 0)
(get_local $7)
)
(return
(get_local $6)
)
)
)
)
)
)
thread 'main' panicked at 'Internal compiler error: invalid generated module', src/trans.rs:84
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment