Skip to content

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

Merged
wixoaGit merged 8 commits into
OpenDreamProject:masterfrom
tontyGH:maxvariableid
May 26, 2026
Merged

Implements DMProc.LocalCount, adds unit test for localvar allocs#2585
wixoaGit merged 8 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
Comment thread Content.Tests/DMProject/SpecialTests/Procs/local_count.dme
Comment thread Content.Tests/RuntimeTests.cs Outdated
Comment thread DMCompiler/DMCompiler.cs Outdated
Comment thread DMCompiler/DMCompiler.cs
tontyGH and others added 2 commits May 26, 2026 12:39
honest to god I tried everything to not have to organize the compiler check like that but it wouldn't accept anything else

Co-authored-by: wixoa <wixoag@gmail.com>
@tontyGH tontyGH requested a review from wixoaGit May 26, 2026 17:04
@wixoaGit wixoaGit enabled auto-merge (squash) May 26, 2026 17:08
@wixoaGit wixoaGit merged commit 817c2c3 into OpenDreamProject:master May 26, 2026
21 checks passed
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

3 participants