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

fix gcc12_error #52441

Conversation

risemeup1
Copy link
Contributor

@risemeup1 risemeup1 commented Apr 1, 2023

PR types

Bug fixes

PR changes

Others

Describe

Pcard-67010
修复可能使用悬空指针指向未命名的临时对象的错误,当指针指向的内存空间已被释放或不再有效的时候,gcc12就会报这个错误,我们可以使用static 延长局部变量的生命周期,直到程序运行结束以后才释放,可以避免此错误。

image

@paddle-bot
Copy link

paddle-bot bot commented Apr 1, 2023

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

Copy link
Contributor

@zhangbo9674 zhangbo9674 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@risemeup1 risemeup1 merged commit 5702b4d into PaddlePaddle:develop Apr 3, 2023
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