Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gists-immunefi/764116c3a8e102c04e86b60789fd027b to your computer and use it in GitHub Desktop.
Save gists-immunefi/764116c3a8e102c04e86b60789fd027b to your computer and use it in GitHub Desktop.
/// Returns a list of all registers *read* by instruction `self`.
pub(crate) fn use_registers(&self) -> BTreeSet<&VirtualRegister> {
use VirtualOp::*;
(match self {
/* Arithmetic/Logic (ALU) Instructions */
...
WQAM(_, r2, r3, r4) => vec![r2, r3, r4],
...
})
.into_iter()
.collect()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment