Now users don't have to manually deal with getFirstLoadCommandInfo() /
getNextLoadCommandInfo(), calculate the number of load segments, etc.
Additionally, the iterator has a support for error handling, that
would allow to detect the case when the next load command cannot be
parsed.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Wait a second, this is stupid. We're walking through all load commands in the constructor and fail to create an object if another command can't be parsed. We should just cache all the load commands in a vector, and get rid of all this ErrorOr<> stuff. I'll update the patch shortly, sorry for noise.
Comment Actions
Alright, now this changes significantly simplifies the users' code - they can use a simple foreach to iterate over all load commands. I will add error recovery for the case when we can't parse load command info in a subsequent change. This one has NFC. Please take a look.