-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
The code for passing arguments into format strings relies on equality of function pointers. This is in conflict with the fact that we set unnamed_addr
on all functions.
Global variables can be marked with unnamed_addr which indicates that the address is not significant, only the content. Constants marked like this can be merged with other constants if they have the same initializer.
Lines 295 to 301 in 618f5a0
fn as_usize(&self) -> Option<usize> { | |
if self.formatter as usize == ArgumentV1::show_usize as usize { | |
Some(unsafe { *(self.value as *const _ as *const usize) }) | |
} else { | |
None | |
} | |
} |
It might be possible for a user to write a function that gets merged with ArgumentV1::show_usize
, and then cause bugs in the above code.
hanna-kruppe
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.