CpuProfiler give up get function info when function hclass is nullptr

issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I7VFVQ

Signed-off-by: scw <suchongwei@huawei.com>
This commit is contained in:
scw 2023-08-23 18:09:33 +08:00
parent 709dcbfb2f
commit fe3a1a5eed

View File

@ -537,7 +537,13 @@ inline bool JSTaggedValue::IsJSNativePointer() const
inline bool JSTaggedValue::CheckIsJSNativePointer() const
{
return IsHeapObject() && !IsInvalidValue() && GetTaggedObject()->GetClass()->IsJSNativePointer();
if (IsHeapObject() && !IsInvalidValue()) {
auto hclass = GetTaggedObject()->GetClass();
if (hclass != nullptr) {
return hclass->IsJSNativePointer();
}
}
return false;
}
inline bool JSTaggedValue::IsSymbol() const
@ -552,7 +558,13 @@ inline bool JSTaggedValue::IsJSProxy() const
inline bool JSTaggedValue::CheckIsJSProxy() const
{
return IsHeapObject() && !IsInvalidValue() && GetTaggedObject()->GetClass()->IsJSProxy();
if (IsHeapObject() && !IsInvalidValue()) {
auto hclass = GetTaggedObject()->GetClass();
if (hclass != nullptr) {
return hclass->IsJSProxy();
}
}
return false;
}
inline bool JSTaggedValue::IsBoolean() const
@ -996,7 +1008,13 @@ inline bool JSTaggedValue::IsJSFunctionBase() const
inline bool JSTaggedValue::CheckIsJSFunctionBase() const
{
return IsHeapObject() && !IsInvalidValue() && GetTaggedObject()->GetClass()->IsJSFunctionBase();
if (IsHeapObject() && !IsInvalidValue()) {
auto hclass = GetTaggedObject()->GetClass();
if (hclass != nullptr) {
return hclass->IsJSFunctionBase();
}
}
return false;
}
inline bool JSTaggedValue::IsBoundFunction() const