Repository navigation
Conversation
Member
|
Thanks for the thorough fix and tests! Reproduced all three issues and confirmed the patch is correct on Lua 5.1 and LuaJIT. Merging after CI passes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
math.random()polyfill with zero arguments returned a constant1, soprobabilistic checks like
math.random() < 0.5in pipeline steps never fired.math.randomseed, givingsrand(-2147483648)on every run. Unseededobfuscations were byte-identical (10/10 runs).
io.popenhandle was never closed, and empty/missing OpenSSL output producedseed
0, bypassing theos.time()fallback.Changes
math.random().2147483647, close the popen handle, validate the output.io.popen,os.timeoros.clockare unavailable (e.g. Luau).tests/harness/random-seed.lua(including the fallback path),annotated with
-- @runtime lua51 luajit.Testing
docker-test-runner.lua --suite=existing --iterations=10(inside Docker, lua5.1 and luau, all presets): 3420 transformed passed / 0 failed, 57 baselines passed, 0 timeouts.tests/harness/*.luapass on Lua 5.1 and LuaJIT 2.1.Seed = 12345) stays deterministic.Notes
math.random()polyfill previously always returned1,so
math.random() < xbranches in pipeline steps were never taken. They are nowreachable, which changes the obfuscated output of affected steps/presets. No
config or API changes. Happy to split this into a separate PR if you prefer.
os.time+os.clock) is not cryptographically strong; it isonly used when OpenSSL is unavailable.