mirror of
https://github.com/ddidderr/wuffs.git
synced 2026-11-23 16:52:18 +01:00
Tweak liveness analysis for if-else chains
This commit is contained in:
1 parent
14f5859311
commit
97eb1290f5
3 files changed
+12
-13
No files matched your search
@@ -121,6 +121,11 @@ func (q *checker) tcheckStatement(n *a.Node) error {
|
||||
}
|
||||
|
||||
case a.KIf:
|
||||
for n := n.AsIf(); n != nil; n = n.ElseIf() {
|
||||
if (n.ElseIf() != nil) && (len(n.BodyIfFalse()) > 0) {
|
||||
return fmt.Errorf("check: if has an else-if and an else-not-if")
|
||||
}
|
||||
}
|
||||
for n := n.AsIf(); n != nil; n = n.ElseIf() {
|
||||
cond := n.Condition()
|
||||
if cond.Effect() != 0 {
|
||||
|
||||
Reference in new issue
Block a user