##// END OF EJS Templates
packaging: ship all help .txt files on WiX...
packaging: ship all help .txt files on WiX These are technically not needed. But it is easier to ship all files than to cherry-pick. A `make install` will copy these files, so the new behavior is consistent with that. This also makes WiX consistent with Inno, which is my main reason for doing this. If we don't want to ship the files (which is a valid argument), I think we can do that in a follow up. Differential Revision: https://phab.mercurial-scm.org/D7166

File last commit:

r41051:b444407f default
r44016:697c2e32 default
Show More
dirstate.cc
48 lines | 1.1 KiB | text/x-c | CppLexer
#include <Python.h>
#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <string>
#include "pyutil.h"
extern "C" {
static PyCodeObject *code;
extern "C" int LLVMFuzzerInitialize(int *argc, char ***argv)
{
contrib::initpy(*argv[0]);
code = (PyCodeObject *)Py_CompileString(R"py(
from parsers import parse_dirstate
try:
dmap = {}
copymap = {}
p = parse_dirstate(dmap, copymap, data)
except Exception as e:
pass
# uncomment this print if you're editing this Python code
# to debug failures.
# print e
)py",
"fuzzer", Py_file_input);
return 0;
}
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
{
PyObject *text =
PyBytes_FromStringAndSize((const char *)Data, (Py_ssize_t)Size);
PyObject *locals = PyDict_New();
PyDict_SetItemString(locals, "data", text);
PyObject *res = PyEval_EvalCode(code, contrib::pyglobals(), locals);
if (!res) {
PyErr_Print();
}
Py_XDECREF(res);
Py_DECREF(locals);
Py_DECREF(text);
return 0; // Non-zero return values are reserved for future use.
}
}