Skip to content

Commit 0ed0769

Browse files
committed
Remove uninitialized member from Base
1 parent ba40a8a commit 0ed0769

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
@@ -31,9 +31,6 @@ def simplify(expr: T) -> T:
3131
simplification_cache[expr.hash()] = expr
3232
return expr
3333

34-
# Copy some parameters (that should really go to the Annotation backend)
35-
simplified._uninitialized = expr.uninitialized
36-
3734
# dealing with annotations
3835
if expr.annotations:
3936
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
@@ -113,9 +113,6 @@ class Base:
113113
# Caching
114114
_cached_encoded_name: bytes | None
115115

116-
# Extra information
117-
_uninitialized: bool
118-
119116
__slots__ = [
120117
"op",
121118
"args",
@@ -129,7 +126,6 @@ class Base:
129126
"_relocatable_annotations",
130127
"_errored",
131128
"_cached_encoded_name",
132-
"_uninitialized",
133129
"__weakref__",
134130
]
135131

@@ -144,7 +140,6 @@ def __new__( # pylint:disable=redefined-builtin
144140
symbolic: bool | None = None,
145141
variables: frozenset[str] | None = None,
146142
errored: set[Backend] | None = None,
147-
uninitialized: bool = False,
148143
annotations: tuple[Annotation, ...] = (),
149144
skip_child_annotations: bool = False,
150145
length: int | None = None,
@@ -218,7 +213,6 @@ def __new__( # pylint:disable=redefined-builtin
218213
symbolic=symbolic,
219214
length=length,
220215
errored=errored,
221-
uninitialized=uninitialized,
222216
annotations=annotations,
223217
encoded_name=encoded_name,
224218
depth=depth,
@@ -241,7 +235,6 @@ def make_like(
241235
annotations: tuple[Annotation, ...] | None = None,
242236
variables: frozenset[str] | None = None,
243237
symbolic: bool | None = None,
244-
uninitialized: bool = False,
245238
skip_child_annotations: bool = False,
246239
length: int | None = None,
247240
) -> Self:
@@ -254,7 +247,6 @@ def make_like(
254247
and annotations
255248
and variables is None
256249
and symbolic is None
257-
and uninitialized is False
258250
and skip_child_annotations
259251
and length is not None
260252
):
@@ -282,7 +274,6 @@ def make_like(
282274
symbolic=self.symbolic,
283275
annotations=annotations,
284276
length=length,
285-
uninitialized=self._uninitialized,
286277
)
287278

288279
result._hash = h
@@ -297,8 +288,6 @@ def make_like(
297288
annotations = self.annotations if not args or not any(self is arg for arg in args) else ()
298289
if variables is None and op in all_operations:
299290
variables = self.variables
300-
if uninitialized is None:
301-
uninitialized = self._uninitialized
302291
if symbolic is None and op in all_operations:
303292
symbolic = self.symbolic
304293

@@ -307,7 +296,6 @@ def make_like(
307296
args if simplified is None else simplified.args,
308297
annotations=annotations,
309298
variables=variables,
310-
uninitialized=uninitialized,
311299
symbolic=symbolic,
312300
skip_child_annotations=skip_child_annotations,
313301
length=length,
@@ -322,7 +310,6 @@ def __a_init__(
322310
symbolic: bool | None = None,
323311
length: int | None = None,
324312
errored: set[Backend] | None = None,
325-
uninitialized: bool = False,
326313
annotations: tuple[Annotation, ...] | None = None,
327314
encoded_name: bytes | None = None,
328315
depth: int | None = None,
@@ -353,8 +340,6 @@ def __a_init__(
353340

354341
self._errored = errored if errored is not None else set()
355342

356-
self._uninitialized = uninitialized
357-
358343
if len(self.args) == 0:
359344
raise ClaripyOperationError("AST with no arguments!")
360345

@@ -963,16 +948,3 @@ def cardinality(self) -> int:
963948
@property
964949
def concrete(self) -> bool:
965950
return not self.symbolic
966-
967-
@property
968-
def uninitialized(self) -> bool:
969-
"""
970-
Whether this AST comes from an uninitialized dereference or not. It's only used in under-constrained symbolic
971-
execution mode.
972-
973-
:returns: True/False/None (unspecified).
974-
"""
975-
976-
# TODO: It should definitely be moved to the proposed Annotation backend.
977-
978-
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)