Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update unicode.hpp #380

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Update unicode.hpp #380

wants to merge 2 commits into from

Conversation

lijun4727
Copy link
Contributor

Resolved in Windows platform, the program exit crash

Resolved in Windows platform, the program exit crash
@betachen
Copy link
Member

@lijun4727 can you explain where it crashed. why we modified like this.

@betachen
Copy link
Member

可以用中文

@lijun4727
Copy link
Contributor Author

@betachen
Windows Debug模式中,mvs-cli.exe执行完命令时,程序崩溃。
因为unicode.hpp中,在字符集为宽字符的情况下,修改了窄字符全局环境变量environ,该变量在_environ_table中被引用,程序退出时,_wenviron_table会释放宽字符申请的内存,而此时_environ_table中的字符串地址和_wenviron_table是相同的,此时释放_environ_table时,发现environ不为NULL,从而,释放堆中该处内存,导致崩溃,因为environ处内存在_wenviron_table中已经被释放。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants