Skip to content

fix(gta-core-five): guard crmtComposer binary-op against empty operand stacks#3945

Open
Holfz wants to merge 1 commit into
citizenfx:masterfrom
Holfz:holfz/fix-crmt-binary-op-stack-underflow
Open

fix(gta-core-five): guard crmtComposer binary-op against empty operand stacks#3945
Holfz wants to merge 1 commit into
citizenfx:masterfrom
Holfz:holfz/fix-crmt-binary-op-stack-underflow

Conversation

@Holfz
Copy link
Copy Markdown

@Holfz Holfz commented Apr 21, 2026

Goal of this PR

Another crmtComposer stack underflow, this time on the consumer side.

The binary-op factory (pop two from parallel stacks, produce one combined record) never checks whether either source stack is non-empty before doing counter - 1 and indexing.

How is this PR achieving the goal

Guard on the factory via hook::trampoline. If either counter is 0 at entry, just return.
The function's side effects (allocating a record, linking into the arrays, decrementing the counters) all get skipped, and the composer's walker moves on to the next node on its own.

This PR applies to the following area(s)

FiveM

Successfully tested on

Game builds: 3095, 3258, 3407
Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

fixes #3669

@github-actions github-actions Bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Apr 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Requires changes before it's considered valid and can be (re)triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Car–Motorcycle Collision at High FPS causing crash

1 participant