* src/native/vm/java_lang_Object.c (wait): Check for ms < 0.
authortwisti <none@none>
Tue, 21 Aug 2007 15:12:38 +0000 (15:12 +0000)
committertwisti <none@none>
Tue, 21 Aug 2007 15:12:38 +0000 (15:12 +0000)
src/native/vm/java_lang_Object.c

index 191ed2448ebde4cd97625b352cb10c246c75af79..b44aff16658849ea7d1dd34fec19b41d96ba6053 100644 (file)
@@ -120,6 +120,12 @@ void _Jv_java_lang_Object_wait(java_lang_Object *o, s8 ms, s4 ns)
        if (jvmti) jvmti_MonitorWaiting(true, o, ms);
 #endif
 
+    if (ms < 0) {
+/*             exceptions_throw_illegalargumentexception("argument out of range"); */
+               exceptions_throw_illegalargumentexception();
+               return;
+       }
+
 #if defined(ENABLE_THREADS)
        lock_wait_for_object(&LLNI_field_direct(o, header), ms, ns);
 #endif