[riscv64] Fix of accidently sampled corrupt stack frame by cpu-profiler

Bug: v8:12144
Change-Id: I19821db79a6a4453ad2120450b5f7b247599f276
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3118554
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Commit-Queue: Ji Qiu <qiuji@iscas.ac.cn>
Cr-Commit-Position: refs/heads/main@{#76500}
This commit is contained in:
QiuJi 2021-08-26 12:06:20 +08:00 committed by V8 LUCI CQ
parent 454272dfca
commit ba9ccd972e

View File

@ -176,7 +176,9 @@ class StackFrame {
intptr_t type = marker >> kSmiTagSize;
// TODO(petermarshall): There is a bug in the arm simulators that causes
// invalid frame markers.
#if defined(USE_SIMULATOR) && (V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_ARM)
#if (defined(USE_SIMULATOR) && \
(V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_ARM)) || \
V8_TARGET_ARCH_RISCV64
if (static_cast<uintptr_t>(type) >= Type::NUMBER_OF_TYPES) {
// Appease UBSan.
return Type::NUMBER_OF_TYPES;