transpile: Fix translation failures exposed by SQLite - #2001
Merged
Conversation
thedataking
force-pushed
the
perl/sqlite-transpiler-fixes
branch
from
September 8, 2026 02:33
f409fa9 to
c6c1988
Compare
thedataking
marked this pull request as ready for review
September 8, 2026 03:24
thedataking
force-pushed
the
perl/sqlite-transpiler-fixes
branch
from
September 8, 2026 03:34
c6c1988 to
2ec4c4d
Compare
ahomescu
reviewed
Sep 8, 2026
ahomescu
reviewed
Sep 8, 2026
thedataking
force-pushed
the
perl/sqlite-transpiler-fixes
branch
from
September 10, 2026 02:18
2ec4c4d to
ea90ce8
Compare
Contributor
Author
|
Updated to use |
Translation units without declarations have no AST nodes to register their main file. Exporting comments then introduces a file ID absent from the file table, causing include-path lookup to panic. Register the main file before serializing the table so comments always refer to an exported file.
…ointers Exposed-provenance constructors require Sized pointees, but forward declarations become unsized extern types. Construct a c_void pointer first, then cast to the opaque pointer type while preserving its constness. This allows integer sentinel values and runtime addresses to initialize opaque pointers in both supported Rust editions.
… va_arg An enclosing cast can prevent Rust from inferring the destination of the transmute used for nullable function pointers. Pass the converted C type explicitly so va_arg results can be assigned through function pointer typedefs and struct fields.
Rust atomic intrinsics reject Option<fn>, the representation of nullable C function pointers. Convert atomic operands to raw pointers and convert results back to their function pointer type. Share the conversion between Clang atomic expressions and legacy __sync builtins. Preserve null callbacks, exchange and compare-exchange results, and the expected value written back after a failed comparison. Lock release stores a null raw pointer instead of an integer zero.
Default initialization does not handle CTypeKind::Atomic, so local _Atomic declarations fail to translate even when they have an explicit initializer. Delegate to the underlying value type to produce the initializer for the atomic storage.
thedataking
force-pushed
the
perl/sqlite-transpiler-fixes
branch
from
September 10, 2026 06:30
ea90ce8 to
b72bfb8
Compare
ahomescu
approved these changes
Sep 10, 2026
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.
Fix five translation failures exposed by SQLite's individual source files:
c_voidpointers. Exposed-provenance constructors require sized pointees, while opaque extern types are unsized.va_arg. Enclosing casts can prevent Rust from inferring it.__sync_*builtins. Rust's atomic intrinsics reject theOption<fn>representation of nullable C callbacks._Atomicstorage through its underlying value type. Default initialization otherwise fails for local atomic declarations, including explicitly initialized ones.