Benign cargo Download

prog.rs

Contains an unbounded block loopCode formats a zero-padded integer
SHA-256cba3a933c5dae41c832d3a7bc56b98238c4a450ca44c072878fdaae6f12b0b89

Evidence

imports input::Char lines 1–25
1use std::collections::HashMap;
2use std::cmp::Ordering;
3use std::fmt;
4use std::ops::Deref;
5use std::mem;
6use std::slice;
7use std::sync::Arc;
8
9use input::Char;
10use literals::LiteralSearcher;
11
12/// `InstPtr` represents the index of an instruction in a regex program.
13pub type InstPtr = usize;
14
15/// Program is a sequence of instructions and various facts about thos
16/// instructions.
17#[derive(Clone)]
18pub struct Program {
19 /// A sequence of instructions that represents an NFA.
20 pub insts: Vec<Inst>,
21 /// Pointers to each Match instruction in the sequence.
22 ///
23 /// This is always length 1 unless this program represents a regex set.
24 pub matches: Vec<InstPtr>,
25 …
Megabyte-scale size constant in source lines 95–101
95:18… xes: LiteralSearcher::empty(),
96 dfa_size_limit: 2 * (1<<20),
97 }
98 }
99
100 /// If pc is an index to a no-op instruction (like Save), then return the
101 /// next pc that is not a …
Contains an unbounded block loop lines 101–108
101:35… p instruction.
102 pub fn skip(&self, mut pc: usize) -> usize {
103 loop {
104 match self[pc] {
105 Inst::Save(ref i) => pc = i.goto,
106 _ => return pc,
107 }
108 …
imports self::Inst::* lines 170–174
170:24… ut fmt::Formatter) -> fmt::Result {
171 use self::Inst::*;
172
173 fn with_goto(cur: usize, goto: usize, fmtd: String) -> String {
174 if goto = …
Code formats a zero-padded integer lines 189–193
189:7… Match(slot) => {
190 try!(write!(f, "{:04} Match({:?})", pc, slot))
191 }
192 Save(ref inst) => {
193 let s = format!("{:04} Save( …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.