Skip to main content

Module anchors

Module anchors 

Source

Re-exportsยง

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; ๐Ÿ”’

Structsยง

AnchorIndex ๐Ÿ”’
Source map and branch lookups precomputed once per bytecode.

Constantsยง

MAX_TRACE_HOPS ๐Ÿ”’
The most static jumps AnchorIndex::trace follows.

Functionsยง

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.

Type Aliasesยง

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.