Skip to content

Commit 4683882

Browse files
sequence: documenation
1 parent 58f42f5 commit 4683882

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

capa/capabilities/dynamic.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,12 @@
1111
import collections
1212
from dataclasses import dataclass
1313

14-
from capa.features.address import NO_ADDRESS
1514
import capa.perf
1615
import capa.features.freeze as frz
1716
import capa.render.result_document as rdoc
1817
from capa.rules import Scope, RuleSet
1918
from capa.engine import FeatureSet, MatchResults
20-
from capa.features.common import Feature
19+
from capa.features.address import _NoAddress
2120
from capa.capabilities.common import Capabilities, find_file_capabilities
2221
from capa.features.extractors.base_extractor import CallHandle, ThreadHandle, ProcessHandle, DynamicFeatureExtractor
2322

@@ -126,9 +125,10 @@ def find_thread_capabilities(
126125
if len(sequence_feature_sets) == SEQUENCE_SIZE:
127126
overflowing_feature_set = sequence_feature_sets.popleft()
128127

129-
# these are the top-level features that will no longer have any associated addresses.
130128
for feature, vas in overflowing_feature_set.items():
131-
if vas == { NO_ADDRESS, }:
129+
if len(vas) == 1 and isinstance(next(iter(vas)), _NoAddress):
130+
# `vas == { NO_ADDRESS }` without the garbage.
131+
#
132132
# ignore the common case of global features getting added/removed/trimmed repeatedly,
133133
# like arch/os/format.
134134
continue

0 commit comments

Comments
 (0)