| 392 | } |
| 393 | |
| 394 | static PyObject* ParseCond(PyObject *self, PyObject *args) { |
| 395 | if (__z3_parser == nullptr) { |
| 396 | PyErr_SetString(PyExc_RuntimeError, "parser not initialized"); |
| 397 | return NULL; |
| 398 | } |
| 399 | |
| 400 | PyObject *ret; |
| 401 | dfsan_label label = 0; |
| 402 | uint64_t result = 0; |
| 403 | uint16_t flags = 0; |
| 404 | |
| 405 | if (!PyArg_ParseTuple(args, "IKH", &label, &result, &flags)) { |
| 406 | return NULL; |
| 407 | } |
| 408 | |
| 409 | std::vector<uint64_t> tasks; |
| 410 | if (__z3_parser->parse_cond(label, result, flags & F_ADD_CONS, tasks) != 0) { |
| 411 | PyErr_SetString(PyExc_RuntimeError, "failed to parse condition"); |
| 412 | return NULL; |
| 413 | } |
| 414 | |
| 415 | ret = PyList_New(tasks.size()); |
| 416 | for (size_t i = 0; i < tasks.size(); i++) { |
| 417 | PyObject *task = PyLong_FromUnsignedLongLong(tasks[i]); |
| 418 | PyList_SetItem(ret, i, task); |
| 419 | } |
| 420 | |
| 421 | return ret; |
| 422 | } |
| 423 | |
| 424 | static PyObject* ParseGEP(PyObject *self, PyObject *args) { |
| 425 | if (__z3_parser == nullptr) { |
nothing calls this directly
no test coverage detected