summaryrefslogtreecommitdiffstats
path: root/libjava/java/lang/natClass.cc
diff options
context:
space:
mode:
authoraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-04 18:44:53 +0000
committeraph <aph@138bc75d-0d04-0410-961f-82ee72b054a4>2006-05-04 18:44:53 +0000
commitecc74eeaa9039b5cca365292229f95e4ff0df24b (patch)
tree53c5cc5b6cfb9186e5f76d34fc5fec1124c7e943 /libjava/java/lang/natClass.cc
parentbbfdda8b30845a74660e87202c4bcc24e4c25e2f (diff)
downloadppe42-gcc-ecc74eeaa9039b5cca365292229f95e4ff0df24b.tar.gz
ppe42-gcc-ecc74eeaa9039b5cca365292229f95e4ff0df24b.zip
2006-05-04 Andrew Haley <aph@redhat.com>
* class.c (make_field_value): Always build_address_of fdecl if there is an initializer. 2006-05-03 Andrew Haley <aph@redhat.com> PR libgcj/27352 * expr.c (maybe_rewrite_invocation): New function. (rewrite_arglist_getclass): Likewise. (rules): New. (expand_invoke): Call maybe_rewrite_invocation. * parse.y (patch_invoke): Likewise. * java-tree.h: (maybe_rewrite_invocation): New function. 2006-05-03 Andrew Haley <aph@redhat.com> PR libgcj/27352 * java/lang/Class.java (getClassLoader(Class)): New. forName(String, Class): New. * java/lang/natClass.cc (getClassLoader(Class)): New. 2006-05-02 Andrew Haley <aph@redhat.com> * prims.cc (_Jv_NewMultiArray): Check for phantom class. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113532 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/lang/natClass.cc')
-rw-r--r--libjava/java/lang/natClass.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc
index d88835019f4..887088933f7 100644
--- a/libjava/java/lang/natClass.cc
+++ b/libjava/java/lang/natClass.cc
@@ -115,9 +115,19 @@ java::lang::Class::getClassLoader (void)
if (s != NULL)
{
jclass caller = _Jv_StackTrace::GetCallingClass (&Class::class$);
- ClassLoader *caller_loader = NULL;
- if (caller)
- caller_loader = caller->getClassLoaderInternal();
+ return getClassLoader (caller);
+ }
+
+ return loader;
+}
+
+java::lang::ClassLoader *
+java::lang::Class::getClassLoader (jclass caller)
+{
+ java::lang::SecurityManager *s = java::lang::System::getSecurityManager();
+ if (s != NULL)
+ {
+ ClassLoader *caller_loader = caller->getClassLoaderInternal();
// If the caller has a non-null class loader, and that loader
// is not this class' loader or an ancestor thereof, then do a
OpenPOWER on IntegriCloud