Skip to content

Stack leak in "hello world" test #241

@dmlloyd

Description

@dmlloyd

The hello world test is not cleaning its stack for some reason.

      - method name: helloWorld
        flags: [STATIC]
        method type: ()V
        attributes: [Code]
        code: 
            max stack: 6
            max locals: 0
            attributes: []
            //stack map frame @0: {locals: [], stack: []}
            0: {opcode: GETSTATIC, owner: java/lang/System, field name: out, field type: Ljava/io/PrintStream;}
            3: {opcode: LDC, constant value: Hello world!%n}
            5: {opcode: ICONST_0, constant value: 0}
            6: {opcode: ANEWARRAY, dimensions: 1, descriptor: java/lang/Object}
            9: {opcode: INVOKEVIRTUAL, owner: java/io/PrintStream, method name: printf, method type: '(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/PrintStream;'}
            12: {opcode: GETSTATIC, owner: java/lang/System, field name: out, field type: Ljava/io/PrintStream;}
            15: {opcode: LDC, constant value: Hello world!%n}
            17: {opcode: ICONST_0, constant value: 0}
            18: {opcode: ANEWARRAY, dimensions: 1, descriptor: java/lang/Object}
            21: {opcode: INVOKEVIRTUAL, owner: java/io/PrintStream, method name: printf, method type: '(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/PrintStream;'}
            24: {opcode: GETSTATIC, owner: java/lang/System, field name: out, field type: Ljava/io/PrintStream;}
            27: {opcode: LDC, constant value: Hello world!%n}
            29: {opcode: ICONST_0, constant value: 0}
            30: {opcode: ANEWARRAY, dimensions: 1, descriptor: java/lang/Object}
            33: {opcode: INVOKEVIRTUAL, owner: java/io/PrintStream, method name: printf, method type: '(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/PrintStream;'}
            36: {opcode: GETSTATIC, owner: java/lang/System, field name: out, field type: Ljava/io/PrintStream;}
            39: {opcode: LDC, constant value: Hello world!%n}
            41: {opcode: ICONST_0, constant value: 0}
            42: {opcode: ANEWARRAY, dimensions: 1, descriptor: java/lang/Object}
            45: {opcode: INVOKEVIRTUAL, owner: java/io/PrintStream, method name: printf, method type: '(Ljava/lang/String;[Ljava/lang/Object;)Ljava/io/PrintStream;'}
            48: {opcode: RETURN}

There should be a POP after each INVOKEVIRTUAL of printf.

Metadata

Metadata

Assignees

Labels

2.xIssue applies to Gizmo 2.x

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions