From f88f6224eaf9de850cd439140550720aff310b19 Mon Sep 17 00:00:00 2001 From: ZHANG Yi Date: Tue, 27 Aug 2024 16:42:30 +0800 Subject: [PATCH] Use `checkStatus` to handle the return value of `llvh::isArray` `runtime_` is modified on error and restored in `checkStatus`, So it should be safe to remove the constness and call `checkStatus` here. --- API/hermes/hermes.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/API/hermes/hermes.cpp b/API/hermes/hermes.cpp index 0a9fba13c00..19018f98227 100644 --- a/API/hermes/hermes.cpp +++ b/API/hermes/hermes.cpp @@ -1997,9 +1997,7 @@ void HermesRuntimeImpl::setPropertyValue( bool HermesRuntimeImpl::isArray(const jsi::Object &obj) const { auto res = llvh::isArray(runtime_, llvh::dyn_vmcast(phv(obj))); - if (LLVM_UNLIKELY(res == llvh::ExecutionStatus::EXCEPTION)) { - return false; - } + const_cast(this)->checkStatus(res.getStatus()); return *res; }