MCPcopy Create free account
hub / github.com/R-Fuzz/symsan / ParseCond

Function ParseCond

python/symsan-py.cpp:394–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

392}
393
394static 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
424static PyObject* ParseGEP(PyObject *self, PyObject *args) {
425 if (__z3_parser == nullptr) {

Callers

nothing calls this directly

Calls 2

parse_condMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected