This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ and Java CNI: Check Java references
Tom Tromey writes:
> >>>>> "Richard" == Richard Henderson <rth@redhat.com> writes:
>
> >> jobjectArray
> >> java::io::File::performList (JavaPointer<java::io::FilenameFilter> filter,
> >> JavaPointer<java::io::FileFilter> fileFilter,
> >> JavaPointer<java::lang::Class> result_type)
>
> Interestingly, Andrew's example is incorrect. You also need
> JavaPointer<jobjectArray>.
Why's that? Surely the definition of jobjectArray would be a typedef
of a JavaPointer.
Anyway, it's just dawned on me that this solution could never work:
the `this' pointer in C++ isn't a smart pointer, so references to
instance data and methods would not be checked. We'd always have to
copy `this' to a smart pointer and reference instance data via that.
(Or check `this' at method entry.) This is all getting rather
horrible.
I think we should go with Plan A.
Andrew.