Fix the DFA for "unstructured controlflow" (#14263)
* Fix the DFA for "unstructured controlflow" * Add testcase from #14233
This commit is contained in:
parent
1a1e9986a3
commit
42db75c970
3 changed files with 142 additions and 81 deletions
|
|
@ -10,6 +10,7 @@ end false
|
|||
begin true
|
||||
if
|
||||
end true
|
||||
7
|
||||
'''
|
||||
cmd: "nim c --gc:arc -d:danger $file"
|
||||
disabled: "true"
|
||||
|
|
@ -53,3 +54,26 @@ proc orIsHard(cond: bool) =
|
|||
|
||||
orIsHard(false)
|
||||
orIsHard(true)
|
||||
|
||||
type
|
||||
Control = ref object
|
||||
x: int
|
||||
|
||||
MouseEvent = ref object
|
||||
control: Control
|
||||
button: int
|
||||
|
||||
proc run(data: Control) =
|
||||
var evt = MouseEvent(button: 1)
|
||||
evt.control = data
|
||||
if evt.button == 1:
|
||||
discard
|
||||
else:
|
||||
return
|
||||
|
||||
echo data.x
|
||||
|
||||
var c = Control(x: 7)
|
||||
|
||||
run(c)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue