Scripts: reject GDK vtable slots outside u8 #2648
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2658"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T05:14:56Z.
gen_gdk_table.pyaccepts a vtable slot above 255 and overwrites the generated Rust table with a value that cannot fit itsu8field. Validate the slot width before opening the output file, so a bad input keeps the last usable table.What is in it
Tested
b49be183, the new regression failed because slot 256 exited successfully and replaced the table. On this branch, full Python script discovery passed 26/26 on Windows; the focused CLI test independently passed.git diff --checkand an independent source review passed. Open PR #1267 reorganizes the same generator, so a mechanical rebase may be needed if it lands first.Regression run
Not tested
AI use
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:32:23Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:36:14Z.
Triage (#1607) – head
d489d6fNo open PR adds a slot range check to gen_gdk_table.py. #2681 (strip comments) and #2724 (validate GUIDs, stacked on #2681) change other parts of the script; the lines shared with them are the test's temp-dir setup. #1267 restructures the output code but adds no range check.
The generated table types the slot as
u8, so exiting before the output file is opened for a slot over 255 keeps a bad row from replacing gdk_table.rs; the test checks that the old file is left unchanged. No problems found in the diff.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
Imported from ivall/xcl. Originally posted by Decodere on 2026-12-02T09:05:18Z.
merge-check
base:
1c8b551475head:
d489d6fbf2merge: clean (
git merge --no-editonto1c8b5514,git diff --checkclean;scripts/gen_gdk_table.pyandscripts/test_gen_gdk_table.py, +41/-0)build: not run (Tier 0 Python generator diff; no Rust code changed)
tests:
python -m unittest discover -s scripts -p "test_gen_gdk_table.py" -v-> 1 passed, 0 failed (new test file);python -m unittest discover -s scripts -p "test_*.py"-> 66 passed, 1 error (test_discord_mirror.pyon Windows, same failure on base1c8b5514). Rust workspace tests not run (Tier 0).review: Read the full diff (+41/-0). Validates every parsed vtable slot fits in
u8(int(slot) > 255exits with a diagnostic atscripts/gen_gdk_table.py:14-16) before openinggdk_table.rsfor writing, so invalid input cannot overwrite the generated Rust file. The new test verifies slot255succeeds and slot256fails while preserving the prior output byte-for-byte. No problems found.performance: none (offline table generator in
scripts/; zero runtime impact)verdict: safe to merge
hardware / tool and model: NVIDIA GeForce RTX 4060 8 GB (driver 621.40), Intel Core i5-11400F, 32 GB RAM, Windows 11 Build 26200, Python 3.15.2, Rust 1.100.1 MSVC, DXC 1.9.2602.17 / Antigravity (Gemini 4 Neon)
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.