Variable debuginfo introduces undefined behaviour #105386
Labels
A-debuginfo
Area: Debugging information in compiled programs (DWARF, PDB, etc.)
A-mir-opt-inlining
Area: MIR inlining
C-bug
Category: This is a bug.
When generating a variable debuginfo, rustc emits an expression describing the address of a source variable. Since #83941, rustc also evaluates this expression.
The expression can contain indirections, and it is not always valid to evaluate it. Consider a source variable that is described indirectly in terms of a base
LocalRef::Place
local. The source variable will be introduced at the beginning of a function, but at this point the base local might be uninitialized. For example:Note that
%1 = load
has!nonnull
and!noundef
metadata but loaded value is uninitialized.(This leads to end-to-end miscompilation with -Cdebuginfo=2).
cc @wesleywiser, @nagisa #83941
The text was updated successfully, but these errors were encountered: