Skip to content

Commit dc6af03

Browse files
committed
Fix infinite loop when using leading wildcards with find_all_pattern
1 parent 4accde8 commit dc6af03

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

include/libhat/scanner.hpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,8 +433,8 @@ LIBHAT_EXPORT namespace hat {
433433
i = end;
434434
break;
435435
}
436-
const auto addr = const_cast<typename detail::result_type_for<In>::underlying_type>(result.get() - offset);
437-
*out++ = addr;
436+
const auto addr = const_cast<typename detail::result_type_for<In>::underlying_type>(result.get());
437+
*out++ = addr - offset;
438438
i = addr + detail::to_stride(alignment);
439439
}
440440

@@ -485,8 +485,8 @@ LIBHAT_EXPORT namespace hat {
485485
if (!result.has_result()) {
486486
break;
487487
}
488-
const auto addr = const_cast<typename detail::result_type_for<In>::underlying_type>(result.get() - offset);
489-
*out++ = addr;
488+
const auto addr = const_cast<typename detail::result_type_for<In>::underlying_type>(result.get());
489+
*out++ = addr - offset;
490490
i = addr + detail::to_stride(alignment);
491491
matches++;
492492
}

0 commit comments

Comments
 (0)