From ba9ccd972e61d98a5b2851f56e07869c1244e1a9 Mon Sep 17 00:00:00 2001 From: QiuJi Date: Thu, 26 Aug 2021 12:06:20 +0800 Subject: [PATCH] [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 Commit-Queue: Ji Qiu Cr-Commit-Position: refs/heads/main@{#76500} --- src/execution/frames.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/execution/frames.h b/src/execution/frames.h index 80ff2eab6d..d81a9dd878 100644 --- a/src/execution/frames.h +++ b/src/execution/frames.h @@ -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(type) >= Type::NUMBER_OF_TYPES) { // Appease UBSan. return Type::NUMBER_OF_TYPES;