This is an automated email from the ASF dual-hosted git repository.

tqchen pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-tvm.git


The following commit(s) were added to refs/heads/main by this push:
     new d955718  don't validate AttrInitEntry until a value has attempted to 
be set (#6672)
d955718 is described below

commit d955718cfe300d3ed294cacb0c74f8ea73ae6ad0
Author: Andrew Reusch <[email protected]>
AuthorDate: Mon Oct 12 16:55:51 2020 -0700

    don't validate AttrInitEntry until a value has attempted to be set (#6672)
---
 include/tvm/ir/attrs.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/tvm/ir/attrs.h b/include/tvm/ir/attrs.h
index 279a791..e92baf1 100644
--- a/include/tvm/ir/attrs.h
+++ b/include/tvm/ir/attrs.h
@@ -336,7 +336,10 @@ struct AttrInitEntry {
   // internal value.
   T* value_;
   // whether the value is missing.
-  bool value_missing_{true};
+  // NOTE: initialize to false so that the destructor does not throw unless
+  // AttrInitVisitor::operator() is committed to returning an instance of this 
class.
+  // It is expected not to set this to true until that is true.
+  bool value_missing_{false};
 
   AttrInitEntry() = default;
 

Reply via email to