Skip to content

Commit d393518

Browse files
author
leinlin
committed
解决掉一个堆栈不对的BUG
1 parent e84488d commit d393518

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

LuaProfiler/Tools/InjectLua.exe

0 Bytes
Binary file not shown.

LuaProfiler/Tools/InjectLua/InjectLua/Parse/Parse.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ static void InsertSample(LLex l, ref int lastPos, ref int nextPos, int tokenType
187187
case (int)TK.RETURN:
188188
int insertPos = lastPos - 1;
189189

190+
if (lastStackToken == (int)TK.FUNCTION && tokens.Count == 1)
191+
{
192+
hasReturn = true;
193+
}
194+
190195
if (tokens.Count == 0)
191196
{
192197
needLastSample = false;
@@ -239,11 +244,6 @@ static void InsertSample(LLex l, ref int lastPos, ref int nextPos, int tokenType
239244
break;
240245
}
241246
}
242-
243-
if (lastStackToken != (int)TK.IF)
244-
{
245-
hasReturn = true;
246-
}
247247
break;
248248
case (int)TK.END:
249249
if (tokens.Count > 0)

LuaProfiler/example/Assets/LuaProfiler/Core/Driver/Parse/Parse.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,11 @@ static void InsertSample(LLex l, ref int lastPos, ref int nextPos, int tokenType
187187
case (int)TK.RETURN:
188188
int insertPos = lastPos - 1;
189189

190+
if (lastStackToken == (int)TK.FUNCTION && tokens.Count == 1)
191+
{
192+
hasReturn = true;
193+
}
194+
190195
if (tokens.Count == 0)
191196
{
192197
needLastSample = false;
@@ -239,11 +244,6 @@ static void InsertSample(LLex l, ref int lastPos, ref int nextPos, int tokenType
239244
break;
240245
}
241246
}
242-
243-
if (lastStackToken != (int)TK.IF)
244-
{
245-
hasReturn = true;
246-
}
247247
break;
248248
case (int)TK.END:
249249
if (tokens.Count > 0)

LuaProfiler/example/Assets/LuaProfiler/Editor/Window/ProfilerWin/TreeView/LuaProfilerTreeView.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,8 @@ public LuaProfilerTreeView(TreeViewState treeViewState, float width)
441441
//NetWorkClient.ConnectServer("127.0.0.1", 23333);
442442

443443
//LuaProfiler.SetSampleEnd(LoadRootSample);
444+
showAlternatingRowBackgrounds = true;
445+
showBorder = true;
444446
m_root = LuaProfilerTreeViewItem.Create(null, -1, null);
445447
needRebuild = true;
446448
multiColumnHeader.sortingChanged += (header) => { needRebuild = true; };

0 commit comments

Comments
 (0)