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
Silent wrong layout: two modules declaring a same-named type share one LLVM struct in codegen #1446
Two modules that each declare a type with the same name get one LLVM struct in codegen: the program reads one module's values through the other's layout — silent wrong code.
use dupa1430
use dupb1430
fn main:
let a = make_a()
show_a(&a)
let b = make_b()
show_b(&b)
Prints a 1724130190 / b bee 7; expected a 1111111111111 2222222222222.
Where
src/Codegen.w Pass 0a/0b key named LLVM types by the declaration's bare name symbol (self.pool.get_data0(decl)), so both Item declarations register the same struct_type_map entry and the later declaration's body overwrites the first's (declare_struct_type sets the one named struct's body twice). Sema already distinguishes the two types; codegen needs a per-declaration (module-qualified) type identity. (#1430 keeps the existing first-declaration behavior for a reference and does not change this.)
Activity
Codegen: each type declaration gets its own LLVM type; a name two mod…
Codegen: each type declaration gets its own LLVM type; a name two mod…
Codegen: each type declaration gets its own LLVM type; a name two mod…
Discriminants are i64 end to end: Sema computes them from the literal…
Discriminants are i64 end to end: Sema computes them from the literal…
Sema: `Self { .. }` in a method body is the method's own declaration;…
Discriminants are i64 end to end: Sema computes them from the literal…
Sema: `Self { .. }` in a method body is the method's own declaration;…
Codegen: a std-tier declaration a user type shadows keeps its layout …
Type checker: D74 entry sources and chain moves, field-view bindings (#…
D65: methods and trait impls of same-named types are their declaratio…
The LLVM backend reads a sizeof/alignof type argument from Sema inste…
The LLVM backend reads a sizeof/alignof type argument from Sema inste…
#1647 phases 2–4 completion: owner facts in codegen, per-instance Sem…
c_import: `typedef struct node node;` over an incomplete struct decla…
wave d65e (#2063)