mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-25 08:55:11 +01:00
An "if" with no "else" does not terminate.
This commit is contained in:
1 parent
638fb8d67d
commit
20d914f849
1 file changed
+3
-2
@@ -355,12 +355,13 @@ func terminates(body []*a.Node) bool {
|
|||||||
if !terminates(n.BodyIfTrue()) {
|
if !terminates(n.BodyIfTrue()) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if bif := n.BodyIfFalse(); len(bif) > 0 && !terminates(bif) {
|
bif := n.BodyIfFalse()
|
||||||
|
if len(bif) > 0 && !terminates(bif) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
n = n.ElseIf()
|
n = n.ElseIf()
|
||||||
if n == nil {
|
if n == nil {
|
||||||
return true
|
return len(bif) > 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user