Skip to content

Commit

Permalink
example for select
Browse files Browse the repository at this point in the history
  • Loading branch information
AntDum authored and danleh committed Aug 11, 2023
1 parent 894f0cb commit fe12347
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions examples/taint/simple/select_taint.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
(module
(import "imports" "output" (func $print (;0;) (param i32)))

(func $source (param i32))
(export "taint_source" (func $source))
(func $sink (param i32))
(export "taint_sink" (func $sink))

(func $f (local $locA i32)
i32.const 10
local.set $locA

;; mark locA as tainted
local.get $locA
call $source

local.get $locA ;; select if true
i32.const 20 ;; select if false

i32.const 1 ;; true
select

;; pass value to sink
call $sink
)

(start $f)
)

0 comments on commit fe12347

Please sign in to comment.