tqchen commented on code in PR #443:
URL: https://github.com/apache/tvm-ffi/pull/443#discussion_r2801777721
##########
src/ffi/extra/serialization.cc:
##########
@@ -245,8 +280,20 @@ class ObjectGraphDeserializer {
if (decoded_nodes_[node_index] != nullptr) {
return decoded_nodes_[node_index];
}
+ if (active_decode_nodes_.find(node_index) != active_decode_nodes_.end()) {
+ TVM_FFI_THROW(RuntimeError) << "Cyclic references are only supported for
ffi.List in "
+ << "FromJSONGraph";
+ }
+ active_decode_nodes_.insert(node_index);
Review Comment:
use RAII guard
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]