Skip to content

Commit

Permalink
fix empty source map
Browse files Browse the repository at this point in the history
  • Loading branch information
publicqi committed Sep 22, 2023
1 parent 189440e commit e7761f0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/evm/concolic/concolic_host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use crate::evm::middlewares::middleware::MiddlewareType::Concolic;
use crate::evm::middlewares::middleware::{add_corpus, Middleware, MiddlewareType};

use crate::evm::host::{FuzzHost, JMP_MAP};
use crate::evm::srcmap::parser::SourceMapLocation;
use crate::generic_vm::vm_executor::MAP_SIZE;
use crate::generic_vm::vm_state::VMStateT;
use crate::input::VMInputT;
Expand Down Expand Up @@ -1191,7 +1192,17 @@ where
// println!("input: {:?}", self.input_bytes);
if let Some(Some(srcmap)) = self.source_map.get(&address) {
// println!("source line: {:?}", srcmap.get(&pc).unwrap());
let source_map_loc = srcmap.get(&pc).unwrap();
let source_map_loc = if srcmap.get(&pc).is_some() {
srcmap.get(&pc).unwrap()
} else {
&SourceMapLocation {
file: None,
file_idx: None,
offset: 0,
length: 0,
skip_on_concolic :false
}
};
if let Some(_file) = &source_map_loc.file {
if source_map_loc.skip_on_concolic {
need_solve = false;
Expand Down

0 comments on commit e7761f0

Please sign in to comment.