I am talking about lua5.4 work2. In fact it can't be reproduced on gcc or lua5.3.
--actboy168
local function test()
test()
end
test()
In lua compiled in msvc2017, this code will cause a crash.
When you say crash, do you mean other than a normal Lua error and traceback? An error and traceback is to be expected with this code since infinite recursion like this will eventually overflow the call stack. This is what I get on Linux, compiled with gcc:
$ lua
Lua 5.3.5 Copyright (C) 1994-2018 Lua.org, PUC-Rio
> do
>> local function test()
>> test()
>> end
>> test()
>> end
stdin:3: stack overflow
stack traceback:
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
...
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in upvalue 'test'
stdin:3: in local 'test'
stdin:5: in main chunk
[C]: in ?
If that's what you're getting, then the behavior is correct. On the other hand, if you're getting a segmentation fault or some other strange non-Lua error, then I'm sure the Lua team would appreciate more details as to exactly what is occurring.