Drop cached expr MBounds when re-checking asserts

Updates https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=21371
This commit is contained in:
Nigel Tao committed 2020-03-26 08:14:43 +11:00
1 parent 58351d44da
commit 40d200cdab
4 files changed
+21 -8

No files matched your search

+9
View File
@@ -236,6 +236,13 @@ func (n *Node) Walk(f func(*Node) error) error {
return nil
}
func dropExprCachedMBounds(n *Node) error {
if n.kind == KExpr {
n.mBounds = interval.IntRange{nil, nil}
}
return nil
}
type Loop interface {
AsNode() *Node
HasBreak() bool
@@ -390,6 +397,8 @@ func (n *Assert) Reason() t.ID { return n.id2 }
func (n *Assert) Condition() *Expr { return n.rhs.AsExpr() }
func (n *Assert) Args() []*Node { return n.list0 }
func (n *Assert) DropExprCachedMBounds() error { return n.AsNode().Walk(dropExprCachedMBounds) }
func NewAssert(keyword t.ID, condition *Expr, reason t.ID, args []*Node) *Assert {
return &Assert{
kind: KAssert,