Commit 2781d585 authored by Milad Fa's avatar Milad Fa Committed by Commit Bot

[regexp] Fix endianness issue when reading bytecode names

Change-Id: I2f6e76d93309f44f90a24c2ce93f324b44a8fc6b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2544921Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Commit-Queue: Milad Fa <mfarazma@redhat.com>
Cr-Commit-Position: refs/heads/master@{#71271}
parent 8bdc2585
......@@ -12,16 +12,17 @@ namespace v8 {
namespace internal {
void RegExpBytecodeDisassembleSingle(const byte* code_base, const byte* pc) {
PrintF("%s", RegExpBytecodeName(*pc));
int bytecode = *reinterpret_cast<const int32_t*>(pc) & BYTECODE_MASK;
PrintF("%s", RegExpBytecodeName(bytecode));
// Args and the bytecode as hex.
for (int i = 0; i < RegExpBytecodeLength(*pc); i++) {
for (int i = 0; i < RegExpBytecodeLength(bytecode); i++) {
PrintF(", %02x", pc[i]);
}
PrintF(" ");
// Args as ascii.
for (int i = 1; i < RegExpBytecodeLength(*pc); i++) {
for (int i = 1; i < RegExpBytecodeLength(bytecode); i++) {
unsigned char b = pc[i];
PrintF("%c", std::isprint(b) ? b : '.');
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment