This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] _Jv_CompileMethod


>>>>> "Keith" == Keith Seitz <keiths@redhat.com> writes:

Keith> 2006-01-18  Keith Seitz  <keiths@redhat.com>
Keith>          * include/java-interp.h (_Jv_CompileMethod): Add declaration.
Keith>          (class _Jv_InterpMethod): Add _Jv_CompileMethod as a friend.
Keith>          * interpret.cc (_Jv_CompileMethod): New function.
Keith>          (run):  Massage code to allow for NULL args.
Keith>          Update comments to explain NULL args.
Keith>          Return if compiling the method and args is NULL.

I like how you added the new _Jv_CompileMethod entry point.

I think there is a subtle race...

Keith> +      if (args == NULL)
Keith> +	return;

Suppose multiple threads call _Jv_CompileMethod at the same time.
In this case I think it is possible for one of the threads to bypass
the whole 'meth->prepared == NULL' code -- and then crash because
it will have args==NULL (but will have skipped this return).

I think this can be avoided by moving this 'if' outside of the one
that checks whether the method has been prepared.

If you agree, make the change and check it in.  If you don't, let's
discuss more...

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]