Skip to content

[Bug]: Different error report #46

@CppCXY

Description

@CppCXY

Prerequisites

  • I have searched existing issues to ensure this isn't a duplicate
  • I am using the latest version or main branch

Bug Description

local iterations = 100000

-- table.move
local src = {}
for i = 1, 1000 do src[i] = i end
local dst = {}
start = os.clock()
for i = 1, iterations / 10 do
    table.move(src, 1, 1000, 1, dst)
end

-- remove for next
for i = 1, iterations do
end

rilua will report:

 Lua.lua:10: attempt to call local '(for index)' (a nil value)
stack traceback:
        Lua.lua:10: in main chunk
        [C]: ?

if I remove the last for loop like:

local iterations = 100000

-- table.move
local src = {}
for i = 1, 1000 do src[i] = i end
local dst = {}
start = os.clock()
for i = 1, iterations / 10 do
    table.move(src, 1, 1000, 1, dst)
end

it will report:

Lua.lua:10: attempt to call field 'move' (a nil value)
stack traceback:
        Lua.lua:10: in main chunk
        [C]: ?

Expected Behavior

They should report the same error.

Steps to Reproduce

same bug description

Version

last release

Rust Toolchain

stable

Operating System

Windows

Cargo Output

Backtrace

Additional Context

Out of curiosity, I did a simple test and quickly discovered this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions