File: overlapping-segments.wast

package info (click to toggle)
binaryen 120-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 41,284 kB
  • sloc: cpp: 189,449; javascript: 62,189; ansic: 14,087; python: 5,379; pascal: 441; sh: 77; makefile: 30; asm: 27
file content (27 lines) | stat: -rw-r--r-- 560 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(module
  (type $none_=>_i32 (func (result i32)))

  (table $0 46 funcref)
  (elem $0 (i32.const 9) $1)
  (elem $1 (i32.const 9) $0)

  (export "test1" (func $2))

  (func $0 (result i32)
    (unreachable)
  )
  (func $1 (result i32)
    (i32.const 65)
  )
  (func $2
    (drop
      (call_indirect (type $none_=>_i32)
        ;; Calling the item at index $9 should call $0, which appears in the
        ;; last of the overlapping segments. That function traps, which stops
        ;; us from evalling anything here.
        (i32.const 9)
      )
    )
  )
)