Skip to content
This repository was archived by the owner on Apr 19, 2019. It is now read-only.
This repository was archived by the owner on Apr 19, 2019. It is now read-only.

Error running JVML-JIT #14

Open
Open

Description

@SquidDev

This project

easm:159: Bad argument, Index expected, got nil
At: java.lang.System.<clinit>()V:23

Both on LuaJ and Cobalt versions

Activity

  1. SquidDev commented on Oct 9, 2016

    @SquidDev
    OwnerAuthor

    A minimal reproduction:

    for i=1, 1 do
        local ca
        for v = 1, 1 do
            if v then ca = v end
        end
    
        assert(ca);
        (function() return ca end)()
    end
  2. SquidDev commented on Oct 13, 2016

    @SquidDev
    OwnerAuthor

    It appears that the upvalue is being opened on the for loop, resulting in it being cleared each iteration. We either need to defer opening the variable or move opening to before the loop.

    Currently

    local ca
    for v = 1, 1 do
        -- Upvalue created here (and after the last iteration)
        if v then ca = v end
    end
    
    assert(ca);
    (function() return ca end)()

    Ideally

    local ca -- Upvalue created here
    for v = 1, 1 do
        if v then ca = v end
    end
    
    assert(ca);
    
    -- Or here
    (function() return ca end)()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions