mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
Avoid potential assertion error.
This commit is contained in:
parent
e4ebcbb6a4
commit
fc16ceb935
@ -115,12 +115,11 @@ local function execute(env, command, ...)
|
|||||||
end
|
end
|
||||||
table.insert(args, 1, true)
|
table.insert(args, 1, true)
|
||||||
args.n = #args
|
args.n = #args
|
||||||
local thread, reason = process.load(shell.resolve(program, "lua"), env, nil, command)
|
local thread, reason = process.load(program, env, nil, command)
|
||||||
if not thread then
|
if not thread then
|
||||||
return false, reason
|
return false, reason
|
||||||
else
|
|
||||||
os.setenv ( '_', shell.resolve (program, "lua") )
|
|
||||||
end
|
end
|
||||||
|
os.setenv("_", program)
|
||||||
local result = nil
|
local result = nil
|
||||||
-- Emulate CC behavior by making yields a filtered event.pull()
|
-- Emulate CC behavior by making yields a filtered event.pull()
|
||||||
while args[1] and coroutine.status(thread) ~= "dead" do
|
while args[1] and coroutine.status(thread) ~= "dead" do
|
||||||
|
@ -721,6 +721,9 @@ class Machine(val owner: Owner, constructor: Constructor[_ <: Architecture]) ext
|
|||||||
|
|
||||||
private def switchTo(value: Machine.State.Value) = {
|
private def switchTo(value: Machine.State.Value) = {
|
||||||
val result = state.pop()
|
val result = state.pop()
|
||||||
|
if (value == Machine.State.Stopping || value == Machine.State.Restarting) {
|
||||||
|
state.clear()
|
||||||
|
}
|
||||||
state.push(value)
|
state.push(value)
|
||||||
if (value == Machine.State.Yielded || value == Machine.State.SynchronizedReturn) {
|
if (value == Machine.State.Yielded || value == Machine.State.SynchronizedReturn) {
|
||||||
remainIdle = 0
|
remainIdle = 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user