Skip to content

Commit a5d2d42

Browse files
committed
Remove uninitialized member from Base
1 parent 9bbd134 commit a5d2d42

File tree

10 files changed

+34
-163
lines changed

10 files changed

+34
-163
lines changed

claripy/algorithm/simplify.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ def simplify(expr: T) -> T:
2424
log.debug("Unable to simplify expression")
2525
return expr
2626

27-
# Copy some parameters (that should really go to the Annotation backend)
28-
simplified._uninitialized = expr.uninitialized
29-
3027
# dealing with annotations
3128
if expr.annotations:
3229
ast_args = tuple(a for a in expr.args if isinstance(a, Base))

claripy/ast/base.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,6 @@ class Base:
124124
# Caching
125125
_cached_encoded_name: bytes | None
126126

127-
# Extra information
128-
_uninitialized: bool
129-
130127
__slots__ = [
131128
"op",
132129
"args",
@@ -141,7 +138,6 @@ class Base:
141138
"_relocatable_annotations",
142139
"_errored",
143140
"_cached_encoded_name",
144-
"_uninitialized",
145141
"__weakref__",
146142
]
147143

@@ -156,7 +152,6 @@ def __new__( # pylint:disable=redefined-builtin
156152
symbolic: bool | None = None,
157153
variables: frozenset[str] | None = None,
158154
errored: set[Backend] | None = None,
159-
uninitialized: bool = False,
160155
annotations: tuple[Annotation, ...] = (),
161156
skip_child_annotations: bool = False,
162157
length: int | None = None,
@@ -230,7 +225,6 @@ def __new__( # pylint:disable=redefined-builtin
230225
symbolic=symbolic,
231226
length=length,
232227
errored=errored,
233-
uninitialized=uninitialized,
234228
annotations=annotations,
235229
encoded_name=encoded_name,
236230
depth=depth,
@@ -253,7 +247,6 @@ def make_like(
253247
annotations: tuple[Annotation, ...] | None = None,
254248
variables: frozenset[str] | None = None,
255249
symbolic: bool | None = None,
256-
uninitialized: bool = False,
257250
skip_child_annotations: bool = False,
258251
length: int | None = None,
259252
) -> Self:
@@ -266,7 +259,6 @@ def make_like(
266259
and annotations
267260
and variables is None
268261
and symbolic is None
269-
and uninitialized is False
270262
and skip_child_annotations
271263
and length is not None
272264
):
@@ -294,7 +286,6 @@ def make_like(
294286
symbolic=self.symbolic,
295287
annotations=annotations,
296288
length=length,
297-
uninitialized=self._uninitialized,
298289
)
299290

300291
result._hash = h
@@ -309,8 +300,6 @@ def make_like(
309300
annotations = self.annotations if not args or not any(self is arg for arg in args) else ()
310301
if variables is None and op in all_operations:
311302
variables = self.variables
312-
if uninitialized is None:
313-
uninitialized = self._uninitialized
314303
if symbolic is None and op in all_operations:
315304
symbolic = self.symbolic
316305

@@ -319,7 +308,6 @@ def make_like(
319308
args if simplified is None else simplified.args,
320309
annotations=annotations,
321310
variables=variables,
322-
uninitialized=uninitialized,
323311
symbolic=symbolic,
324312
skip_child_annotations=skip_child_annotations,
325313
length=length,
@@ -335,7 +323,6 @@ def __a_init__(
335323
length: int | None = None,
336324
simplified: SimplificationLevel = SimplificationLevel.UNSIMPLIFIED,
337325
errored: set[Backend] | None = None,
338-
uninitialized: bool = False,
339326
annotations: tuple[Annotation, ...] | None = None,
340327
encoded_name: bytes | None = None,
341328
depth: int | None = None,
@@ -368,8 +355,6 @@ def __a_init__(
368355

369356
self._simplified = simplified
370357

371-
self._uninitialized = uninitialized
372-
373358
if len(self.args) == 0:
374359
raise ClaripyOperationError("AST with no arguments!")
375360

@@ -1061,16 +1046,3 @@ def cardinality(self) -> int:
10611046
@property
10621047
def concrete(self) -> bool:
10631048
return not self.symbolic
1064-
1065-
@property
1066-
def uninitialized(self) -> bool:
1067-
"""
1068-
Whether this AST comes from an uninitialized dereference or not. It's only used in under-constrained symbolic
1069-
execution mode.
1070-
1071-
:returns: True/False/None (unspecified).
1072-
"""
1073-
1074-
# TODO: It should definitely be moved to the proposed Annotation backend.
1075-
1076-
return self._uninitialized

claripy/ast/bv.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -291,9 +291,9 @@ def SI(
291291
)
292292

293293

294-
def TSI(bits, name=None, uninitialized=False, explicit_name=None):
294+
def TSI(bits, name=None, explicit_name=None):
295295
name = "unnamed" if name is None else name
296-
return BVS(name, bits, uninitialized=uninitialized, explicit_name=explicit_name)
296+
return BVS(name, bits, explicit_name=explicit_name)
297297

298298

299299
def ESI(bits, **kwargs):

claripy/ast/strings.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,11 @@ def indexOf(self, pattern, start_idx):
4747
return StrIndexOf(self, pattern, start_idx)
4848

4949

50-
def StringS(name, uninitialized=False, explicit_name=False, **kwargs):
50+
def StringS(name, explicit_name=False, **kwargs):
5151
"""
5252
Create a new symbolic string (analogous to z3.String())
5353
5454
:param name: The name of the symbolic string (i. e. the name of the variable)
55-
:param uninitialized: Whether this value should be counted as an "uninitialized" value in the course of an
56-
analysis.
5755
:param bool explicit_name: If False, an identifier is appended to the name to ensure uniqueness.
5856
5957
:returns: The String object representing the symbolic string
@@ -63,7 +61,6 @@ def StringS(name, uninitialized=False, explicit_name=False, **kwargs):
6361
"StringS",
6462
(n,),
6563
symbolic=True,
66-
uninitialized=uninitialized,
6764
variables=frozenset((n,)),
6865
**kwargs,
6966
)

claripy/backends/backend_vsa/backend_vsa.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,8 @@ def widen(self, ast):
465465
return ret
466466

467467
@staticmethod
468-
def CreateTopStridedInterval(bits, name=None, uninitialized=False):
469-
return StridedInterval.top(bits, name, uninitialized=uninitialized)
468+
def CreateTopStridedInterval(bits, name=None):
469+
return StridedInterval.top(bits, name)
470470

471471
def constraint_to_si(self, expr):
472472
return Balancer(self, expr).compat_ret

0 commit comments

Comments
 (0)