Skip to content

Commit

Permalink
解决掉一个堆栈不对的BUG
Browse files Browse the repository at this point in the history
  • Loading branch information
leinlin committed May 11, 2020
1 parent e84488d commit d393518
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
Binary file modified LuaProfiler/Tools/InjectLua.exe
Binary file not shown.
10 changes: 5 additions & 5 deletions LuaProfiler/Tools/InjectLua/InjectLua/Parse/Parse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ static void InsertSample(LLex l, ref int lastPos, ref int nextPos, int tokenType
case (int)TK.RETURN:
int insertPos = lastPos - 1;

if (lastStackToken == (int)TK.FUNCTION && tokens.Count == 1)
{
hasReturn = true;
}

if (tokens.Count == 0)
{
needLastSample = false;
Expand Down Expand Up @@ -239,11 +244,6 @@ static void InsertSample(LLex l, ref int lastPos, ref int nextPos, int tokenType
break;
}
}

if (lastStackToken != (int)TK.IF)
{
hasReturn = true;
}
break;
case (int)TK.END:
if (tokens.Count > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ static void InsertSample(LLex l, ref int lastPos, ref int nextPos, int tokenType
case (int)TK.RETURN:
int insertPos = lastPos - 1;

if (lastStackToken == (int)TK.FUNCTION && tokens.Count == 1)
{
hasReturn = true;
}

if (tokens.Count == 0)
{
needLastSample = false;
Expand Down Expand Up @@ -239,11 +244,6 @@ static void InsertSample(LLex l, ref int lastPos, ref int nextPos, int tokenType
break;
}
}

if (lastStackToken != (int)TK.IF)
{
hasReturn = true;
}
break;
case (int)TK.END:
if (tokens.Count > 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,8 @@ public LuaProfilerTreeView(TreeViewState treeViewState, float width)
//NetWorkClient.ConnectServer("127.0.0.1", 23333);

//LuaProfiler.SetSampleEnd(LoadRootSample);
showAlternatingRowBackgrounds = true;
showBorder = true;
m_root = LuaProfilerTreeViewItem.Create(null, -1, null);
needRebuild = true;
multiColumnHeader.sortingChanged += (header) => { needRebuild = true; };
Expand Down

0 comments on commit d393518

Please sign in to comment.