Skip to content

Conversation

@AyushAnand-28
Copy link

Fixes: #60895

The error (trampoline_pos - fixup_pos) <= kMaxBranchOffset on RISC-V
indicates that the trampoline pool is being emitted too late, causing
branch targets to be out of range.

This commit increases BlockPoolsScope::kGap in assembler-riscv.h
from 16 slots to 32 slots. This increases the safety margin, ensuring
that the trampoline pool is checked and emitted earlier, preventing
the branch offset overflow.

Fixes: nodejs#60895

The error (trampoline_pos - fixup_pos) <= kMaxBranchOffset on RISC-V indicates that the trampoline pool is being emitted too late, causing branch targets to be out of range.

This commit increases BlockPoolsScope::kGap in assembler-riscv.h from 16 slots to 32 slots. This increases the safety margin, ensuring that the trampoline pool is checked and emitted earlier, preventing the branch offset overflow.
@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/security-wg
  • @nodejs/v8-update

@nodejs-github-bot nodejs-github-bot added needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency. labels Nov 30, 2025
Copy link
Member

@Renegade334 Renegade334 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no reason we would be merging ephemeral downstream V8 patches for an unsupported architecture.

If there's a jump issue in the V8 riscv assembler, it should be reported and addressed upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-ci PRs that need a full CI run. v8 engine Issues and PRs related to the V8 dependency.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RISCV] Check failed: (trampoline_pos - fixup_pos) <= kMaxBranchOffset.

3 participants