diff --git a/taichi/ir/statements.h b/taichi/ir/statements.h index a006e99b12ca09..2a9c0a7aa59fa8 100644 --- a/taichi/ir/statements.h +++ b/taichi/ir/statements.h @@ -367,9 +367,11 @@ class PtrOffsetStmt : public Stmt { bool is_local_ptr() const { if (origin->is() || origin->is()) { - auto is_tensor_type = origin->ret_type->is() ? - origin->ret_type->cast()->get_pointee_type()->is() : - origin->ret_type->is(); + auto is_tensor_type = origin->ret_type->is() + ? origin->ret_type->cast() + ->get_pointee_type() + ->is() + : origin->ret_type->is(); TI_ASSERT_INFO(is_tensor_type, "PtrOffsetStmt can only be used for Alloca (TensorType)."); }