Fixed bug in verifier (#109)
* Fixed bug in verifier Does not check variable def for unreachable codex * Check reachability first + file test
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
8c60555409
commit
f867ddbf0c
23
filetests/verifier/unreachable_code.cton
Normal file
23
filetests/verifier/unreachable_code.cton
Normal file
@@ -0,0 +1,23 @@
|
||||
test verifier
|
||||
|
||||
function %test() -> i32 { ; Ok
|
||||
ebb0:
|
||||
v0 = iconst.i32 0
|
||||
v1 = iconst.i32 0
|
||||
jump ebb2
|
||||
|
||||
ebb2:
|
||||
jump ebb4
|
||||
|
||||
ebb4:
|
||||
jump ebb2
|
||||
|
||||
ebb3(v2: i32):
|
||||
v4 = iadd.i32 v1, v2
|
||||
jump ebb9(v4)
|
||||
|
||||
ebb9(v7: i32):
|
||||
v9 = iadd.i32 v2, v7
|
||||
return v9
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user