Skip to content

Implements DMProc.LocalCount, adds unit test for localvar allocs#2585

Open
tontyGH wants to merge 6 commits into
OpenDreamProject:masterfrom
tontyGH:maxvariableid
Open

Implements DMProc.LocalCount, adds unit test for localvar allocs#2585
tontyGH wants to merge 6 commits into
OpenDreamProject:masterfrom
tontyGH:maxvariableid

Conversation

@tontyGH
Copy link
Copy Markdown
Contributor

@tontyGH tontyGH commented May 23, 2026

LocalCount is meant to reflect the max amount of variables a proc COULD allocate during its execution, but it used to just naively reflect Proc.LocalNames.Count which doesn't do Any of That.

Fixes #2583

I had to move some stuff around in the compiler to expose the Json object to the unit test, but I triple checked and it should be equivalent function, and consumers can just ignore the version with output.

@boring-cyborg boring-cyborg Bot added Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime labels May 23, 2026
Comment thread DMCompiler/DM/DMProc.cs Fixed
Comment thread DMCompiler/DMCompiler.cs Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Compiler Involves the OpenDream compiler Runtime Involves the OpenDream server/runtime size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compiler fails to emit the correct local variable count

2 participants