Skip to main content Module anchors Copy item path Source use super::CoverageItemKind ; ๐ use super::ExecutionAnchor ; ๐ use super::ExecutionAnchorKind ; ๐ use super::ItemAnchor ; ๐ use super::ItemAnchors ; ๐ use super::SourceLocation ; ๐ use crate::analysis::BranchKind ; ๐ use crate::analysis::EmptySpecialFunctionKind ; ๐ use crate::analysis::IfArms ; ๐ use crate::analysis::SourceAnalysis ; ๐ use crate::analysis::TernaryArms ; ๐ use alloy_primitives::U256; ๐ use alloy_primitives::map::rustc_hash::FxHashSet; ๐ use evm2::interpreter::op as opcode; ๐ use eyre::ensure ; ๐ use foundry_compilers::artifacts::sourcemap::Jump; ๐ use foundry_compilers::artifacts::sourcemap::SourceElement; ๐ use foundry_compilers::artifacts::sourcemap::SourceMap; ๐ use foundry_evm_core::bytecode::InstIter ; ๐ use foundry_evm_core::ic::IcPcMap ; ๐ use std::ops::Range ; ๐ AnchorIndex ๐ Source map and branch lookups precomputed once per bytecode. MAX_TRACE_HOPS ๐ The most static jumps AnchorIndex::trace follows. constant_revert_selector ๐ Recognizes a constant four-byte error payload in a small straight-line stub. Memory and the
incoming stack are unknown: only bytes explicitly stored by this stub can establish a selector.
Calls, branches, dynamic data, and unsupported operations deliberately leave it unrecognized. find_anchors Attempts to find anchors for the given items using the given source map and bytecode. find_execution_anchors Finds execution-based anchors for empty constructors, receive functions, and fallbacks in a
contract. in_reverting_run ๐ Returns whether instruction is in one of the ordered, disjoint runs. is_in_source_range ๐ Calculates whether element is within the range of the target location. is_within_source_span ๐ Calculates whether element is entirely inside the span of location. jump_destination ๐ Decodes a push immediate as a program counter. EdgeAnchor ๐ An anchor with the conditional jump whose taken edge it counts and the jumps that enter the
fallthrough from elsewhere, as in ItemAnchors::jumps and ItemAnchors::entries .