natVMSecurityManager.cc (getClassContext): Add new arg: klass.

2005-03-17  Andrew Haley  <aph@redhat.com>

	* java/lang/natVMSecurityManager.cc (getClassContext): Add new
	arg: klass.
	Pass klass to _Jv_StackTrace::GetClassContext().
	* java/lang/ClassLoader.java (getParent): Pass class to
	VMSecurityManager.getClassContext()
	(getSystemClassLoader): Likewise.
	* java/lang/Package.java (getPackage): Likewise.
	(getPackages): Likewise.
	* java/lang/SecurityManager.java (getClassContext): Likewise.
	(currentClassLoader): Likewise.
	* java/lang/VMSecurityManager.java: (getClassContext): Likewise.
	(currentClassLoader) Add new arg: caller.
	Pass caller to VMSecurityManager.getClassContext.

	* stacktrace.cc (GetClassContext): Correct calculation of
	jframe_count.

	* boehm.cc (_Jv_MarkObj): (_Jv_MarkObj): Mark
	im->source_file_name.

From-SVN: r96803
This commit is contained in:
Andrew Haley 2005-03-21 14:50:14 +00:00 committed by Andrew Haley
parent 21e01bf10d
commit e5a8980bb9
8 changed files with 45 additions and 22 deletions

View file

@ -486,7 +486,7 @@ public abstract class ClassLoader
SecurityManager sm = System.getSecurityManager();
if (sm != null)
{
Class c = VMSecurityManager.getClassContext()[1];
Class c = VMSecurityManager.getClassContext(ClassLoader.class)[1];
ClassLoader cl = c.getClassLoader();
if (cl != null && ! cl.isAncestorOf(this))
sm.checkPermission(new RuntimePermission("getClassLoader"));
@ -729,7 +729,7 @@ public abstract class ClassLoader
SecurityManager sm = System.getSecurityManager();
if (sm != null)
{
Class c = VMSecurityManager.getClassContext()[1];
Class c = VMSecurityManager.getClassContext(ClassLoader.class)[1];
ClassLoader cl = c.getClassLoader();
if (cl != null && cl != systemClassLoader)
sm.checkPermission(new RuntimePermission("getClassLoader"));