equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
29 */ |
29 */ |
30 /* |
30 /* |
31 Exported function: |
31 Exported function: |
32 |
32 |
33 jboolean |
33 jboolean |
34 VerifyClass(JNIEnv *env, jclass cb, char *message_buffer, |
|
35 jint buffer_length) |
|
36 jboolean |
|
37 VerifyClassForMajorVersion(JNIEnv *env, jclass cb, char *message_buffer, |
34 VerifyClassForMajorVersion(JNIEnv *env, jclass cb, char *message_buffer, |
38 jint buffer_length, jint major_version) |
35 jint buffer_length, jint major_version) |
39 |
36 |
40 This file now only uses the standard JNI and the following VM functions |
37 This file now only uses the standard JNI and the following VM functions |
41 exported in jvm.h: |
38 exported in jvm.h: |
906 assert(context->n_globalrefs == 0); |
903 assert(context->n_globalrefs == 0); |
907 #endif |
904 #endif |
908 |
905 |
909 CCdestroy(context); /* destroy heap */ |
906 CCdestroy(context); /* destroy heap */ |
910 return result; |
907 return result; |
911 } |
|
912 |
|
913 #define OLD_FORMAT_MAX_MAJOR_VERSION 48 |
|
914 |
|
915 JNIEXPORT jboolean |
|
916 VerifyClass(JNIEnv *env, jclass cb, char *buffer, jint len) |
|
917 { |
|
918 static int warned = 0; |
|
919 if (!warned) { |
|
920 jio_fprintf(stdout, "Warning! An old version of jvm is used. This is not supported.\n"); |
|
921 warned = 1; |
|
922 } |
|
923 return VerifyClassForMajorVersion(env, cb, buffer, len, |
|
924 OLD_FORMAT_MAX_MAJOR_VERSION); |
|
925 } |
908 } |
926 |
909 |
927 static void |
910 static void |
928 verify_field(context_type *context, jclass cb, int field_index) |
911 verify_field(context_type *context, jclass cb, int field_index) |
929 { |
912 { |