Skip to content

Commit d336834

Browse files
committed
fix: correct handling of the zero case
1 parent 12e80c5 commit d336834

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/PE/layout_check.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -137,14 +137,14 @@ class LayoutChecker {
137137
}
138138

139139
bool contains(uint64_t va) const {
140+
if (va == 0) {
141+
return true;
142+
}
140143
return vaddr_start <= va && va < vaddr_end;
141144
}
142145

143146
bool contains(optional<uint64_t> va) const {
144-
if (va.value_or(0) == 0) {
145-
return true;
146-
}
147-
return contains(*va);
147+
return contains(va.value_or(0));
148148
}
149149

150150
private:

0 commit comments

Comments
 (0)