diff options
author | Tom Tromey <tromey@redhat.com> | 2001-06-15 23:22:02 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2001-06-15 23:22:02 +0000 |
commit | 6728a61d1f8aaf9d848fce3584e952fb5f0d3f67 (patch) | |
tree | 66a09d8d7bb82b638704942709ea98d649fdbfa3 /libjava/prims.cc | |
parent | 21ea1c28cf21127a3a6e4155a977bd78542a5c4c (diff) | |
download | gcc-6728a61d1f8aaf9d848fce3584e952fb5f0d3f67.tar.gz |
natRuntime.cc (_Jv_FindSymbolInExecutable): Return NULL if no library on the list has the symbol.
* java/lang/natRuntime.cc (_Jv_FindSymbolInExecutable): Return
NULL if no library on the list has the symbol.
(init): Call add_library on the program itself.
* prims.cc (JvRunMain): Initialize Runtime before searching for
`main'.
(_Jv_RunMain): Likewise.
From-SVN: r43413
Diffstat (limited to 'libjava/prims.cc')
-rw-r--r-- | libjava/prims.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libjava/prims.cc b/libjava/prims.cc index f112812aec5..eac47e5fee5 100644 --- a/libjava/prims.cc +++ b/libjava/prims.cc @@ -1008,6 +1008,10 @@ JvRunMain (jclass klass, int argc, const char **argv) _Jv_ThisExecutable (argv[0]); #endif + // Get the Runtime here. We want to initialize it before searching + // for `main'; that way it will be set up if `main' is a JNI method. + java::lang::Runtime *rtime = java::lang::Runtime::getRuntime (); + main_thread = _Jv_AttachCurrentThread (JvNewStringLatin1 ("main"), NULL); arg_vec = JvConvertArgv (argc - 1, argv + 1); runFirst (klass, arg_vec); @@ -1015,7 +1019,7 @@ JvRunMain (jclass klass, int argc, const char **argv) int status = (int) java::lang::ThreadGroup::had_uncaught_exception; - java::lang::Runtime::getRuntime ()->_exit (status); + rtime->_exit (status); } void @@ -1031,6 +1035,10 @@ _Jv_RunMain (const char *name, int argc, const char **argv, bool is_jar) _Jv_ThisExecutable (exec_name); #endif + // Get the Runtime here. We want to initialize it before searching + // for `main'; that way it will be set up if `main' is a JNI method. + java::lang::Runtime *rtime = java::lang::Runtime::getRuntime (); + main_thread = _Jv_AttachCurrentThread (JvNewStringLatin1 ("main"), NULL); if (is_jar) @@ -1061,7 +1069,7 @@ _Jv_RunMain (const char *name, int argc, const char **argv, bool is_jar) int status = (int) java::lang::ThreadGroup::had_uncaught_exception; - java::lang::Runtime::getRuntime ()->exit (status); + rtime->exit (status); } |