Skip to content

fix: detect REGISTRYINDEX at runtime for Lua 5.4/5.5 compat#43

Merged
veelenga merged 1 commit into
masterfrom
fix/ci
Mar 27, 2026
Merged

fix: detect REGISTRYINDEX at runtime for Lua 5.4/5.5 compat#43
veelenga merged 1 commit into
masterfrom
fix/ci

Conversation

@veelenga
Copy link
Copy Markdown
Owner

Summary

  • Detect the linked Lua version at startup and compute the correct REGISTRYINDEX value
  • Lua 5.4 uses -1001000, Lua 5.5 uses -(INT_MAX/2 + 1000) — using the wrong value causes a segfault in lua_rawgeti

Test plan

  • CI passes with Lua 5.4 (Ubuntu)
  • Local specs pass with Lua 5.5 (macOS)

The REGISTRYINDEX constant differs between Lua 5.4 (-1001000) and
Lua 5.5 (-(INT_MAX/2 + 1000)). Detect the linked Lua version at
startup and compute the correct value.
@veelenga veelenga merged commit 5bfd3c7 into master Mar 27, 2026
1 check passed
@veelenga veelenga deleted the fix/ci branch March 27, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant