문제

I'm trying to instantiate a class in Jasmin like this:

new Ljava/lang/Object;
dup
invokespecial java/lang/Object/<init>()V

This does compile but the class vierifier complains:

"VerifyError: Call to wrong initialization method."

What's the correct way to instantiate a class?

도움이 되었습니까?

해결책

Ahh, I found the f***ing problem:

The parameter of 'new' should be the plain qualified name of the type, not it's decorated name. I. e. instead of

new Ljava/lang/Object;

you should write:

new java/lang/Object

The working code is:

new java/lang/Object
dup
invokespecial java/lang/Object/<init>()V

다른 팁

Try with invokespecial java/lang/Object/()V.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top