Skip to content

Commit 2e56851

Browse files
committed
nontermination (if loop termination depends on symbolic value, it will explode the user's stack instead, now it gets out of bounds for the concrete stack in c++)
1 parent ae49b39 commit 2e56851

File tree

2 files changed

+38
-0
lines changed

2 files changed

+38
-0
lines changed

benchmarks/wasm/diverge.wat

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
(module $diverge
2+
(type (;0;) (func (param i32) (result i32)))
3+
(type (;1;) (func))
4+
(type (;2;) (func (param i32)))
5+
(import "console" "assert" (func (;0;) (type 2)))
6+
(import "console" "log" (func (;1;) (type 2)))
7+
;; f x = if x == 0 then 42 else f x
8+
(func (;2;) (type 0) (param i32) (result i32)
9+
local.get 0
10+
i32.const 0
11+
i32.eq
12+
if (result i32)
13+
i32.const 42
14+
else
15+
local.get 0
16+
call 1
17+
local.get 0
18+
call 2
19+
i32.const 0
20+
call 0
21+
unreachable
22+
end
23+
)
24+
(func $real_main (;2;) (type 1)
25+
i32.const 0
26+
i32.symbolic
27+
call 2
28+
drop
29+
)
30+
(start 3)
31+
(export "main" (func 3))
32+
33+
)

src/test/scala/genwasym/TestStagedConcolicEval.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,4 +178,9 @@ class TestStagedConcolicEval extends FunSuite {
178178
test("small-snapshot-concrete") {
179179
testFileConcreteCpp("./benchmarks/wasm/compare_wasp/small-snapshot.wat", Some("main"))
180180
}
181+
182+
// test("diverge") {
183+
// testFileConcolicCpp("./benchmarks/wasm/diverge.wat", Some("main"))
184+
// }
185+
181186
}

0 commit comments

Comments
 (0)