pub struct Protect<'a> {
pub guard: &'a Guard,
pub branch: &'a BranchInsts,
pub scratch: [PhysReg; 2],
}Expand description
What the stack protector’s check needs beyond the frame, in a function that has one.
Three things that come from three places, which is why they arrive together rather than being looked up here. Where the word the canary is copied from lives is a fact about the runtime the code is linked against. What a branch on a register is is a fact about the machine. And the two registers are neither: they are the ones the allocator was told to hold back, which is a decision about the allocator, and they are free at a return for exactly that reason.
Fields§
§guard: &'a GuardWhere the word the canary is a copy of lives, and what to call when the copy has changed.
branch: &'a BranchInstsWhat a branch on a register is, which is what the check ends its block with.
scratch: [PhysReg; 2]The two registers the check may use, which are two the allocator never handed out.