Skip to content

Commit 9905277

Browse files
authored
修复特定情况下查看函数时可能导致报错
1 parent 83a7668 commit 9905277

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

emmy_debugger/src/debugger/emmy_debugger.cpp

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -333,18 +333,19 @@ void DisplayFunction(Idx<Variable> variable, lua_State *L, int index) {
333333
lua_pushvalue(L, index);
334334
if (lua_getinfo(L, ">Snu", &ar) == 0) {
335335
variable->value = ToPointer(L, index);
336-
return;
337336
}
338-
switch (luaVersion) {
339-
case LuaVersion::LUA_54: {
340-
DisplayFunction54(variable, L, index, ar.u.ar54);
341-
break;
342-
}
343-
default: {
344-
variable->value = ToPointer(L, index);
345-
break;
337+
else {
338+
switch (luaVersion) {
339+
case LuaVersion::LUA_54: {
340+
DisplayFunction54(variable, L, index, ar.u.ar54);
341+
break;
342+
}
343+
default: {
344+
variable->value = ToPointer(L, index);
345+
break;
346+
}
346347
}
347-
}
348+
}
348349
lua_settop(L, index);
349350
}
350351
#endif
@@ -1452,4 +1453,4 @@ bool Debugger::RegisterTypeName(const std::string& typeName, std::string& err) {
14521453
displayCustomTypeInfo = true;
14531454
registeredTypes.set(type);
14541455
return true;
1455-
}
1456+
}

0 commit comments

Comments
 (0)