| 481 | } |
| 482 | |
| 483 | static PyObject* RecordMemcmp(PyObject *self, PyObject *args) { |
| 484 | if (__z3_parser == nullptr) { |
| 485 | PyErr_SetString(PyExc_RuntimeError, "parser not initialized"); |
| 486 | return NULL; |
| 487 | } |
| 488 | |
| 489 | dfsan_label label = 0; |
| 490 | PyObject *buf = NULL; |
| 491 | |
| 492 | if (!PyArg_ParseTuple(args, "IS", &label, &buf)) { |
| 493 | return NULL; |
| 494 | } |
| 495 | |
| 496 | Py_ssize_t size; |
| 497 | char *data; |
| 498 | if (PyBytes_AsStringAndSize(buf, &data, &size) != 0) { |
| 499 | // exception should have been set? |
| 500 | return NULL; |
| 501 | } |
| 502 | |
| 503 | if (__z3_parser->record_memcmp(label, (uint8_t*)data, size) != 0) { |
| 504 | PyErr_SetString(PyExc_RuntimeError, "failed to record memcmp"); |
| 505 | return NULL; |
| 506 | } |
| 507 | |
| 508 | Py_RETURN_NONE; |
| 509 | } |
| 510 | |
| 511 | static PyObject* RecordMinimize(PyObject *self, PyObject *args) { |
| 512 | if (__z3_parser == nullptr) { |
nothing calls this directly
no test coverage detected