Ensure that all AST nodes are bounds checked

This commit is contained in:
Nigel Tao committed 2018-07-08 10:42:44 +10:00
1 parent 731ca8841b
commit ee95b548ab
4 files changed
+147 -64

No files matched your search

+1 -6
View File
@@ -393,6 +393,7 @@ func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error {
// structs from used packages.
return fmt.Errorf("check: unrecognized identifier %q", id1.Str(q.tm))
}
switch id1 {
case t.IDFalse:
n.SetConstValue(zero)
@@ -403,12 +404,6 @@ func (q *checker) tcheckExprOther(n *a.Expr, depth uint32) error {
n.SetConstValue(one)
n.SetMType(typeExprBool)
return nil
case t.IDUnderscore:
// TODO.
case t.IDThis:
// TODO.
}
case t.IDOpenParen, t.IDTry: