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

Function SymSanInit

python/symsan-py.cpp:40–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38
39
40static PyObject* SymSanInit(PyObject *self, PyObject *args, PyObject *keywds) {
41 static const char *kwlist[] = {"program", "shm_size", "init_solver", NULL};
42 const char *program;
43 unsigned long long ut_size = uniontable_size;
44 int init_solver = 1; // default True
45
46 if (!PyArg_ParseTupleAndKeywords(args, keywds, "s|Kp",
47 const_cast<char**>(kwlist), &program, &ut_size, &init_solver)) {
48 return NULL;
49 }
50
51 // setup launcher
52 void *shm_base = symsan_init(program, ut_size);
53 if (shm_base == (void *)-1) {
54 fprintf(stderr, "Failed to map shm: %s\n", strerror(errno));
55 return PyErr_SetFromErrno(PyExc_OSError);
56 }
57
58 // setup parser (optional)
59 if (init_solver) {
60 __z3_parser = new symsan::Z3ParserSolver(shm_base, ut_size, __z3_context);
61 if (__z3_parser == nullptr) {
62 fprintf(stderr, "Failed to initialize parser\n");
63 return PyErr_NoMemory();
64 }
65 }
66
67 return PyCapsule_New(shm_base, "dfsan_label_info", NULL);
68}
69
70static PyObject* SymSanConfig(PyObject *self, PyObject *args, PyObject *keywds) {
71 static const char *kwlist[]

Callers

nothing calls this directly

Calls 1

symsan_initFunction · 0.85

Tested by

no test coverage detected