##// END OF EJS Templates
fuzz: report error if Python code raised exception...
Yuya Nishihara -
r40136:ca4a32d0 default
parent child Browse files
Show More
@@ -47,8 +47,8 b' int LLVMFuzzerTestOneInput(const uint8_t'
47 47 PyCodeObject *code =
48 48 (PyCodeObject *)Py_CompileString(R"py(
49 49 from parsers import lazymanifest
50 lm = lazymanifest(mdata)
51 50 try:
51 lm = lazymanifest(mdata)
52 52 # iterate the whole thing, which causes the code to fully parse
53 53 # every line in the manifest
54 54 list(lm.iterentries())
@@ -65,7 +65,11 b' except Exception as e:'
65 65 # print e
66 66 )py",
67 67 "fuzzer", Py_file_input);
68 PyEval_EvalCode(code, globals, locals);
68 PyObject *res = PyEval_EvalCode(code, globals, locals);
69 if (!res) {
70 PyErr_Print();
71 }
72 Py_XDECREF(res);
69 73 Py_DECREF(code);
70 74 Py_DECREF(locals);
71 75 Py_DECREF(mtext);
General Comments 0
You need to be logged in to leave comments. Login now