mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 18:20:04 +00:00
Fix SIGSEGV in AddObjectInfo
Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IALDQE Description Add if statement, when GetReceiverObject is undefined,the process will not go to function AddOnjectInfo Signed-off-by: l00799755 <lujiahui4@huawei.com> Change-Id: Ie7f455ad88aaaff2cc5d3bcb7afa23bb2fb4eed5
This commit is contained in:
parent
f972d1e20e
commit
92ffb6dff2
@ -85,9 +85,9 @@ public:
|
|||||||
return GetReceiverObject() == other.GetReceiverObject() && GetHolderObject() == other.GetHolderObject();
|
return GetReceiverObject() == other.GetReceiverObject() && GetHolderObject() == other.GetHolderObject();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsHole() const
|
bool IsValid() const
|
||||||
{
|
{
|
||||||
return GetReceiverObject().IsHole();
|
return !GetReceiverObject().IsHole() && !GetReceiverObject().IsUndefined();
|
||||||
}
|
}
|
||||||
|
|
||||||
DECL_DUMP()
|
DECL_DUMP()
|
||||||
|
@ -557,7 +557,7 @@ void PGOProfiler::UpdateExtraProfileTypeInfo(ApEntityId abcId,
|
|||||||
if (!key.IsUndefined() && !key.IsHole()) {
|
if (!key.IsUndefined() && !key.IsHole()) {
|
||||||
JSTaggedValue val(dict->GetValue(hashIndex));
|
JSTaggedValue val(dict->GetValue(hashIndex));
|
||||||
ExtraProfileTypeInfo *extraInfo = ExtraProfileTypeInfo::Cast(val.GetTaggedObject());
|
ExtraProfileTypeInfo *extraInfo = ExtraProfileTypeInfo::Cast(val.GetTaggedObject());
|
||||||
if (extraInfo->IsHole()) {
|
if (!extraInfo->IsValid()) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
AddObjectInfo(abcId,
|
AddObjectInfo(abcId,
|
||||||
|
@ -231,6 +231,7 @@ group("ark_aot_ts_test") {
|
|||||||
"pgo_function_prototype",
|
"pgo_function_prototype",
|
||||||
"pgo_gettersetter",
|
"pgo_gettersetter",
|
||||||
"pgo_extrainfomap_expand",
|
"pgo_extrainfomap_expand",
|
||||||
|
"pgo_extrainfomap_gc",
|
||||||
"pgo_inherited_function_operation",
|
"pgo_inherited_function_operation",
|
||||||
"pgo_ldobjbyvalue_array",
|
"pgo_ldobjbyvalue_array",
|
||||||
"pgo_ldobjbyvalue_string",
|
"pgo_ldobjbyvalue_string",
|
||||||
|
19
test/aottest/pgo_extrainfomap_gc/BUILD.gn
Normal file
19
test/aottest/pgo_extrainfomap_gc/BUILD.gn
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
import("//arkcompiler/ets_runtime/test/test_helper.gni")
|
||||||
|
|
||||||
|
host_aot_test_action("pgo_extrainfomap_gc") {
|
||||||
|
deps = []
|
||||||
|
is_enable_pgo = true
|
||||||
|
}
|
14
test/aottest/pgo_extrainfomap_gc/expect_output.txt
Normal file
14
test/aottest/pgo_extrainfomap_gc/expect_output.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
1
|
14
test/aottest/pgo_extrainfomap_gc/pgo_expect_output.txt
Normal file
14
test/aottest/pgo_extrainfomap_gc/pgo_expect_output.txt
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
1
|
25
test/aottest/pgo_extrainfomap_gc/pgo_extrainfomap_gc.ts
Normal file
25
test/aottest/pgo_extrainfomap_gc/pgo_extrainfomap_gc.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2024 Huawei Device Co., Ltd.
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
function foo(a) {
|
||||||
|
const o = {
|
||||||
|
...a,
|
||||||
|
"p1": 1,
|
||||||
|
set p1(arg) {},
|
||||||
|
};
|
||||||
|
print(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
foo({});
|
Loading…
Reference in New Issue
Block a user