Skip to content

Commit 4e901eb

Browse files
authored
🔧 fix: panic on unwrapping last emitted event
🔧 fix: panic on unwrapping last emitted event
2 parents 664dd40 + 7121a16 commit 4e901eb

4 files changed

Lines changed: 10 additions & 4 deletions

File tree

common/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "heimdall-common"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
edition = "2021"
55
license = "MIT"
66
readme = "README.md"

config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "heimdall-config"
3-
version = "0.2.1"
3+
version = "0.2.2"
44
edition = "2021"
55
license = "MIT"
66
readme = "README.md"

heimdall/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ keywords = ["ethereum", "web3", "decompiler", "evm", "crypto"]
55
license = "MIT"
66
name = "heimdall"
77
readme = "README.md"
8-
version = "0.2.1"
8+
version = "0.2.2"
99

1010
[dependencies]
1111
backtrace = "0.3"

heimdall/src/decompile/analyze.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,13 @@ impl VMTrace {
114114
if opcode_number >= 0xA0 && opcode_number <= 0xA4 {
115115

116116
// LOG0, LOG1, LOG2, LOG3, LOG4
117-
let logged_event = operation.events.last().unwrap().to_owned();
117+
let logged_event = match operation.events.last() {
118+
Some(event) => event,
119+
None => {
120+
function.notices.push(format!("unable to decode event emission at instruction {}", instruction.instruction));
121+
continue;
122+
}
123+
};
118124

119125
// check to see if the event is a duplicate
120126
if !function.events.iter().any(|(selector, _)| {

0 commit comments

Comments
 (0)