Skip to content

Update unicode.hpp#380

Open
lijun4727 wants to merge 2 commits intomvs-org:masterfrom
lijun4727:master
Open

Update unicode.hpp#380
lijun4727 wants to merge 2 commits intomvs-org:masterfrom
lijun4727:master

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.

2 participants