Repository navigation
fix: double free - #156
Closed
ushen-pyj wants to merge 2 commits into
Closed
fix: double free#156ushen-pyj wants to merge 2 commits into
ushen-pyj wants to merge 2 commits into
Conversation
Owner
|
因为 n 是 queue 的原长,这个其实应该写成(此为 lua 处理这种移动的惯用写法): table.move(queue, i, n+i-1, 1)这样可以避免在 lua 中引入 for 循环。 |
Contributor
Author
又学会一招 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
stack traceback: [C]: in function 'ltask.unpack_remove' lualib/service.lua:916: in upvalue 'schedule_message' lualib/service.lua:932: in local 'mainloop' lualib/service.lua:941: in main chunk double free or corruption (fasttop)``` 原因在于, table.move 不会截断尾部,消息重复