|
94 | 94 | 'ub': 'upper-bound', |
95 | 95 | 'uio': 'uint-overflow', |
96 | 96 | 'uiu': 'uint-underflow', |
| 97 | + 'up': 'unique-pointer', |
97 | 98 | 'va': 'var-args', |
98 | 99 | 'vc': 'value-constraint', |
99 | 100 | 'vm': 'valid-mem', |
@@ -297,6 +298,10 @@ def is_stack_address_escape(self) -> bool: |
297 | 298 | def is_type_at_offset(self) -> bool: |
298 | 299 | return False |
299 | 300 |
|
| 301 | + @property |
| 302 | + def is_unique_pointer(self) -> bool: |
| 303 | + return False |
| 304 | + |
300 | 305 | @property |
301 | 306 | def is_upper_bound(self) -> bool: |
302 | 307 | return False |
@@ -2182,6 +2187,29 @@ def __str__(self) -> str: |
2182 | 2187 | return "value-constraint(" + str(self.exp) + ")" |
2183 | 2188 |
|
2184 | 2189 |
|
| 2190 | +@pdregistry.register_tag("up", CPOPredicate) |
| 2191 | +class CPOUniquePointer(CPOPredicate): |
| 2192 | + |
| 2193 | + def __init__( |
| 2194 | + self, pd: "CFilePredicateDictionary", ixval: IT.IndexedTableValue |
| 2195 | + ) -> None: |
| 2196 | + CPOPredicate.__init__(self, pd, ixval) |
| 2197 | + |
| 2198 | + @property |
| 2199 | + def exp(self) -> "CExp": |
| 2200 | + return self.cd.get_exp(self.args[0]) |
| 2201 | + |
| 2202 | + @property |
| 2203 | + def is_unique_pointer(self) -> bool: |
| 2204 | + return True |
| 2205 | + |
| 2206 | + def has_variable(self, vid: int) -> bool: |
| 2207 | + return self.exp.has_variable(vid) |
| 2208 | + |
| 2209 | + def __str__(self) -> str: |
| 2210 | + return "unique-pointer(" + str(self.exp) + ")" |
| 2211 | + |
| 2212 | + |
2185 | 2213 | @pdregistry.register_tag("prm", CPOPredicate) |
2186 | 2214 | class CPOPreservedAllMemory(CPOPredicate): |
2187 | 2215 | """preserves-all-memory(): true of a function that does not free any memory. |
|
0 commit comments