[StubGen] Fix optional vectors (#323) (#324) - #329
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Changes affect core RPC stub/proxy code generation behavior and could have broad downstream compilation/runtime impact that warrants final human verification.
Pull request overview
This PR updates the ProxyStubGenerator’s code generation for OptionalType<std::vector<...>> parameters to correctly construct/populate vectors when optional values are present, and to reset optionals when absent, avoiding stale data across calls.
Changes:
- In stub-side input deserialization, populate optional vectors via a temporary vector object and move-assign into the optional wrapper.
- In proxy-side output deserialization, read vectors into either the target vector (clearing first) or a temporary vector for optionals, then move-assign.
- When an optional value is not present on the wire (boolean false), explicitly reset the optional parameter to its default-constructed state.
File summaries
| File | Description |
|---|---|
| ProxyStubGenerator/StubGenerator.py | Fixes generation logic for optional dynamic arrays (vectors) during read/assignment in both stub and proxy paths, including resetting absent optionals. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
This is a backport from R4_4
It addresses an issue where a method's parameter is an optionalType and is empty; IsSet returns true.