提交 49997e44 编写于 作者: N nloodin

Merge

...@@ -89,6 +89,12 @@ ...@@ -89,6 +89,12 @@
(ci)->input_position <= (ci)->input_len && \ (ci)->input_position <= (ci)->input_len && \
(ci)->output_position <= (ci)->output_len) ) (ci)->output_position <= (ci)->output_len) )
#define BUFSIZE 256
#ifdef _WIN32
#define snprintf(buffer, count, format, ...) _snprintf_s(buffer, count, _TRUNCATE, format, ##__VA_ARGS__)
#endif
/* Typedefs for various integral numbers, just for code clarity */ /* Typedefs for various integral numbers, just for code clarity */
typedef unsigned ClassOpcode; /* One opcode */ typedef unsigned ClassOpcode; /* One opcode */
...@@ -651,6 +657,7 @@ cpool_setup(CrwClassImage *ci) ...@@ -651,6 +657,7 @@ cpool_setup(CrwClassImage *ci)
unsigned int index2; unsigned int index2;
unsigned len; unsigned len;
char * utf8; char * utf8;
char message[BUFSIZE];
ipos = i; ipos = i;
index1 = 0; index1 = 0;
...@@ -689,8 +696,20 @@ cpool_setup(CrwClassImage *ci) ...@@ -689,8 +696,20 @@ cpool_setup(CrwClassImage *ci)
utf8[len] = 0; utf8[len] = 0;
write_bytes(ci, (void*)utf8, len); write_bytes(ci, (void*)utf8, len);
break; break;
case JVM_CONSTANT_MethodType:
index1 = copyU2(ci);
break;
case JVM_CONSTANT_MethodHandle:
index1 = copyU1(ci);
index2 = copyU2(ci);
break;
case JVM_CONSTANT_InvokeDynamic:
index1 = copyU2(ci);
index2 = copyU2(ci);
break;
default: default:
CRW_FATAL(ci, "Unknown constant"); snprintf(message, BUFSIZE, "Unknown tag: %d, at ipos %hu", tag, ipos);
CRW_FATAL(ci, message);
break; break;
} }
fillin_cpool_entry(ci, ipos, tag, index1, index2, (const char *)utf8, len); fillin_cpool_entry(ci, ipos, tag, index1, index2, (const char *)utf8, len);
......
...@@ -86,7 +86,8 @@ enum { ...@@ -86,7 +86,8 @@ enum {
JVM_CONSTANT_InterfaceMethodref = 11, JVM_CONSTANT_InterfaceMethodref = 11,
JVM_CONSTANT_NameAndType = 12, JVM_CONSTANT_NameAndType = 12,
JVM_CONSTANT_MethodHandle = 15, // JSR 292 JVM_CONSTANT_MethodHandle = 15, // JSR 292
JVM_CONSTANT_MethodType = 16 // JSR 292 JVM_CONSTANT_MethodType = 16, // JSR 292
JVM_CONSTANT_InvokeDynamic = 18
}; };
/* JVM_CONSTANT_MethodHandle subtypes */ /* JVM_CONSTANT_MethodHandle subtypes */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册