-
Notifications
You must be signed in to change notification settings - Fork 30
Fix data flow analysis for multiple text sections #220
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
base: main
Are you sure you want to change the base?
Conversation
* Data flow analysis results were only keyed by the symbol (function) address. That doen't work if there are multiple text sections, the result from the first function in one section will stomp the result from the first function in another because both have address zero. * Remove the ambiguity by keying off of the section address as well.
PR does build, not sure why clippy is failing for stuff I didn't touch. |
@@ -273,7 +273,7 @@ pub struct Object { | |||
pub path: Option<std::path::PathBuf>, | |||
#[cfg(feature = "std")] | |||
pub timestamp: Option<filetime::FileTime>, | |||
pub flow_analysis_results: BTreeMap<u64, Box<dyn FlowAnalysisResult>>, | |||
flow_analysis_results: BTreeMap<u64, Box<dyn FlowAnalysisResult>>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's keep this pub
, otherwise Object
isn't constructible outside of the crate
symbol: &Symbol, | ||
result: Box<dyn FlowAnalysisResult>, | ||
) { | ||
let key = symbol.section.unwrap_or_default() as u64 + symbol.address; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This key seems like it could easily overlap, the section indices are small numbers
Data flow analysis results were only keyed by the symbol (function) address. That doesn't work if there are multiple text sections. The result from the first function in one text section will stomp the result from the first function in another because both have address zero.
Remove the ambiguity by keying off of the section address as well.