[cfe-dev] clang 3.2 libclang: crash detected during reparsing
Oliver
ogtifs at gmail.com
Tue Jan 15 21:36:47 PST 2013
Hi,
Some example code for document editing I was using with clang 3.1 now
segfaults on clang 3.2:
#include <clang-c/Index.h>
#include <string.h>
char DOCUMENT[] = "int main() { return 0; }\n";
int main(int argc, char** argv) {
const char* args;
CXIndex ci = clang_createIndex(0,0);
CXTranslationUnit tu =
clang_parseTranslationUnit(ci, "main.cpp", &args,
0, NULL, 0, clang_defaultEditingTranslationUnitOptions());
CXUnsavedFile file;
file.Filename = "main.cpp";
file.Contents = DOCUMENT;
file.Length = strlen(DOCUMENT);
clang_reparseTranslationUnit(tu, 1, &file,
clang_defaultEditingTranslationUnitOptions());
return 0;
}
Output is:
libclang: crash detected during reparsing
Segmentation fault (core dumped)
Am I doing something perverted or is this a bug?
Oliver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20130116/0d938874/attachment.html>
More information about the cfe-dev
mailing list