Skip to content

Commit cbba0e3

Browse files
ConvolutedDogtqchen
authored andcommitted
Make slot end calculation more readable
1 parent 85e3689 commit cbba0e3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

include/tvm/runtime/object.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -889,8 +889,8 @@ inline bool Object::IsInstance() const {
889889
uint32_t begin = TargetType::RuntimeTypeIndex();
890890
// The condition will be optimized by constant-folding.
891891
if (TargetType::_type_child_slots != 0) {
892-
uint32_t end = begin + TargetType::_type_child_slots;
893-
if (self->type_index_ >= begin && self->type_index_ <= end) return true;
892+
uint32_t end = begin + TargetType::_type_child_slots + 1;
893+
if (self->type_index_ >= begin && self->type_index_ < end) return true;
894894
} else {
895895
if (self->type_index_ == begin) return true;
896896
}

0 commit comments

Comments
 (0)