Add error-check for yield-in-pcall to traceback_pcall
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "traceback.hpp"
|
||||
|
||||
#include <cstring>
|
||||
#include <cassert>
|
||||
|
||||
#define TRACEBACK_LEVELS1 12
|
||||
#define TRACEBACK_LEVELS2 10
|
||||
@@ -88,7 +89,9 @@ eng::string traceback_pcall(lua_State *L, int narg, int nret) {
|
||||
if ((msg == NULL) || (msg[0] == 0)) {
|
||||
msg = "unknown error";
|
||||
}
|
||||
return msg;
|
||||
eng::string result = msg;
|
||||
assert(result != "attempt to yield from outside a coroutine");
|
||||
return result;
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user