Skip to content

Commit

Permalink
[GCC] Fix build for Debian Stable after 270351@main
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=264299

Reviewed by Yusuke Suzuki.

Wrap memcpy function call into local function to work around build
error.

* Source/JavaScriptCore/assembler/X86Assembler.h:
(JSC::X86Assembler::memcpyWrapper):
(JSC::X86Assembler::replaceWithNops):

Canonical link: https://commits.webkit.org/270526@main
  • Loading branch information
dpino committed Nov 10, 2023
1 parent f5f625b commit 32983fe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Source/JavaScriptCore/assembler/X86Assembler.h
Original file line number Diff line number Diff line change
Expand Up @@ -6391,9 +6391,15 @@ class X86Assembler {
WTF::unalignedStore<int32_t>(ptr + 1, static_cast<int32_t>(distance));
}

// FIXME: Indirection needed to work around GCC error in Debian 11.
static void* memcpyWrapper(void* dest, const void* src, size_t n)
{
return memcpy(dest, src, n);
}

static void replaceWithNops(void* instructionStart, size_t memoryToFillWithNopsInBytes)
{
fillNops<memcpy>(instructionStart, memoryToFillWithNopsInBytes);
fillNops<memcpyWrapper>(instructionStart, memoryToFillWithNopsInBytes);
}

static ptrdiff_t maxJumpReplacementSize()
Expand Down

0 comments on commit 32983fe

Please sign in to comment.