File: stack-direction.wast

package info (click to toggle)
binaryen 99-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 31,352 kB
  • sloc: cpp: 134,831; javascript: 61,839; ansic: 12,369; python: 4,620; pascal: 441; sh: 72; asm: 27; makefile: 6
file content (30 lines) | stat: -rw-r--r-- 611 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
28
29
30
(module
 (type $0 (func))
 (import "env" "memory" (memory $1 256 256))
 (import "env" "STACKTOP" (global $gimport$0 i32))
 (global $global$0 (mut i32) (global.get $gimport$0))
 (export "__post_instantiate" (func $0))
 ;; if the stack goes **down**, this may seem to write to memory we care about
 (func $0 (; 0 ;) (type $0)
  (local $0 i32)
  (i32.store offset=12
   (local.tee $0
    (i32.sub
     (global.get $global$0)
     (i32.const 16)
    )
   )
   (i32.const 10)
  )
  (i32.store offset=12
   (local.get $0)
   (i32.add
    (i32.load offset=12
     (local.get $0)
    )
    (i32.const 1)
   )
  )
 )
)