Skip to content

vm: initialize unused native call arguments - #436

Merged
ec- merged 1 commit into
ec-:mainfrom
msetaro:issue/31-native-dispatch-upstream
Sep 15, 2026
Merged

ec- merged 1 commit into
ec-:mainfrom
msetaro:issue/31-native-dispatch-upstream

Conversation

@msetaro

@msetaro msetaro commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

VM_Call's native path initializes only nargs elements of args[3] but always reads all three when calling entryPoint. Zero-, one- and two-argument calls therefore read uninitialized integers. Clang 21's optimized zero-count call enters an unbounded argument-copy loop and crashes before bot startup.

Initialize the array so unused slots are zero. The included production-body C regression calls a native entry stub with counts 3, 0, 1 and 2 and checks every slot, return value and call depth. It segfaults before and passes after with Clang; its header contains the build/run command. The C++ fork's GCC and Clang tests also pass, and native bot smoke now matches QVM output on both Quake 3 maps. No floating-point expression or golden changes.

@ec-
ec- merged commit f03641f into ec-:main Sep 15, 2026
28 checks passed
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.

2 participants