File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,7 @@ struct LuaThread
108108 int toPush = lua_gettop (parent);
109109 // We only want to resume with the actual number of arguments here, regardless of if the first argument is a thread or a function
110110 int numResumeArgs = toPush > 1 ? toPush - 1 : 0 ;
111- if (!lua_checkstack (L , 1 ))
111+ if (!lua_checkstack (parent , 1 ))
112112 luaL_error (L, " Not enough stack space to create a new thread" );
113113 if (lua_isfunction (parent, 1 ))
114114 {
@@ -163,7 +163,7 @@ struct LuaThread
163163 if (!ok)
164164 {
165165 runtime->reportError (child);
166- return 1 ;
166+ return 1 ;
167167 }
168168
169169 return 1 ;
Original file line number Diff line number Diff line change @@ -23,6 +23,18 @@ test.suite("LuteTaskSuite", function(suite)
2323 assert .eq (endTime - startTime >= 0.5 , true )
2424 end )
2525
26+ suite :case ("taskSpawn0ArgsErrors" , function (assert )
27+ assert .errors (function ()
28+ (task.spawn :: any )()
29+ end )
30+ end )
31+
32+ suite :case ("taskDefer0ArgsErrors" , function (assert )
33+ assert .errors (function ()
34+ (task.defer :: any )()
35+ end )
36+ end )
37+
2638 suite :case ("taskSpawnFunctionNoArgsCoroutineStatus" , function (assert )
2739 local thread = task.spawn (function ()
2840 task.wait (2 )
You can’t perform that action at this time.
0 commit comments