| 1349 | |
| 1350 | |
| 1351 | expr Memory::hasStored(const Pointer &p, const expr &bytes) const { |
| 1352 | assert(has_initializes_attr); |
| 1353 | |
| 1354 | unsigned bytes_per_byte = bits_byte / 8; |
| 1355 | expr bid = p.getShortBid(); |
| 1356 | expr offset = p.getShortOffset(); |
| 1357 | uint64_t bytes_i; |
| 1358 | if (bytes.isUInt(bytes_i) && (bytes_i / bytes_per_byte) <= 8) { |
| 1359 | expr ret = true; |
| 1360 | for (uint64_t off = 0; off < (bytes_i / bytes_per_byte); ++off) { |
| 1361 | expr off_expr = expr::mkUInt(off, offset); |
| 1362 | ret &= has_stored_arg.load(bid.concat(offset + off_expr)); |
| 1363 | } |
| 1364 | return ret; |
| 1365 | } else { |
| 1366 | expr var = expr::mkFreshVar("#off", offset); |
| 1367 | state->addQuantVar(var); |
| 1368 | expr bytes_div = bytes.zextOrTrunc(offset.bits()) |
| 1369 | .udiv(expr::mkUInt(bytes_per_byte, bytes)); |
| 1370 | return (var.uge(offset) && var.ult(offset + bytes_div)) |
| 1371 | .implies(has_stored_arg.load(bid.concat(var))); |
| 1372 | } |
| 1373 | } |
| 1374 | |
| 1375 | void Memory::record_store(const Pointer &p, const smt::expr &bytes) { |
| 1376 | assert(has_initializes_attr); |
no test coverage detected