Refactor isInSrcReadU8 and isLowBits.

This commit is contained in:
Nigel Tao committed 2017-06-09 15:44:43 +10:00
1 parent 711adf5273
commit c1dff0ca41
3 files changed
+22 -6

No files matched your search

+2 -2
View File
@@ -590,11 +590,11 @@ func (q *checker) bcheckExprOther(n *a.Expr, depth uint32) (*big.Int, *big.Int,
case t.KeyOpenParen:
// TODO: delete this hack that only matches "in.src.read_u8?()".
if isInSrcReadU8(q.tm, n.LHS().Expr()) && n.CallSuspendible() && len(n.Args()) == 0 {
if isInSrcReadU8(q.tm, n) {
break
}
// TODO: delete this hack that only matches "foo.low_bits(etc)".
if isLowBits(q.tm, n.LHS().Expr()) && !n.CallImpure() && len(n.Args()) == 1 {
if isLowBits(q.tm, n) {
a := n.Args()[0].Arg().Value()
aMin, aMax, err := q.bcheckExpr(a, depth)
if err != nil {