You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Codegen: a facade callback with () userdata (db.exec(sql, cb, (), null)) traps the compiler in llvm::DataLayout::getTypeSizeInBits (#1618's interim spelling) #1622
Found by the ruling §66 example rewrite (build/release_uat_fixtures/sqlite3_main.w). #1618's interim spelling for an exec with no row callback — a no-op fn with a unit userdata — is not compilable: the compiler itself dies (rc 133, EXC_BREAKPOINT in llvm::DataLayout::getTypeSizeInBits(llvm::Type*) + 452) in with build/with run; with check says ok.
use facades.sqlite3
use c_import("sqlite3.h", link: "sqlite3")
fn no_row_unit(c: &Unit, n: c_int, v: *mut *mut i8, k: *mut *mut i8) -> c_int: 0
fn main:
var db = Database.open(":memory:").unwrap()
print(db.exec("CREATE TABLE t(value INTEGER)", no_row_unit, (), null))
The same call with a struct userdata (type Ctx { tag: i32 }, Ctx { tag: 1 }) or an i32 userdata (0) compiles and runs, with a named fn or a closure (c, n, v, k) => 0 alike — the trigger is U = Unit in the rendered exec[U](…, callback: extern "C" fn(&U, …), ud: &U, …): &Unit/sizeof(Unit) reaches LLVM as a void type. Two defects: the marshalling of a zero-sized userdata, and a compiler abort with no diagnostic. #1618's None spelling removes the need for a unit userdata in this program, but &() through a generic extern callback remains a legal spelling that must not abort the compiler.
lldb: frame #0: with-stage1llvm::DataLayout::getTypeSizeInBits(llvm::Type*) const + 452 (brk #0x1`), no With frames unwound.
Activity
Release UAT: sqlite3_main.w on the SQLite facade surface, 11 unsafe -…
Release UAT: sqlite3_main.w on the SQLite facade surface, 11 unsafe -…
Release UAT: sqlite3_main.w on the SQLite facade surface, 11 unsafe -…
Release UAT: sqlite3_main.w on the SQLite facade surface, 11 unsafe -…
Modeled C §66: UAT and examples rewritten to the facade surface; zlib…
ehartford commentedon Sep 26, 2026
Verified fixed on main 55739d4 (release binary): db.exec(sql, Some(no_row_unit), Some(())) with U = Unit builds, prints 0.