-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Variable debuginfo introduces undefined behaviour #105386
Comments
A variant that demonstrates complete end-to-end miscompilation can be found in #105344 (comment). |
Even without the metadata, this load could violate EDIT: Or does this always load from an |
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: