[cfe-dev] clang via JNI + libclang-c

Renato Golin renato.golin at linaro.org
Fri Oct 11 02:12:43 PDT 2013


On 11 October 2013 10:02, Anton Smirnov <dev at antonsmirnov.name> wrote:

> The problem is that if i do in the same invocation from java (f.e. in
> single Java_name_antonsmirnov_clang_clang_1wrapper_tokenize() function) -
> it works good.
> For example if i just remember parameters and then create index, parse,
> tokenize (clang-c invocations) within tokenize() method it's okay.
>
> If i do everything in separate native methods (clang-c invocation in
> separate native calls from java) (as it's designed to do) pointers are
> corrupted.
> So unpacked CXIndex in parse() invocation is corrupted even if it was
> packed/unpacked correctly and the pointer is the same.
>

This looks a lot like standard JNI stack corruption to me. This is the
exact same behaviour I've seen in JNI 10 years ago, and I'm not surprised
they're still there...

cheers,
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20131011/f94b0068/attachment.html>


More information about the cfe-dev mailing list