镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Fix DateTime::SetTime logging before initialized - #2396

Merged
mark9064 merged 4 commits into
InfiniTimeOrg:mainfrom
pipe01:fix-date-log
Nov 3, 2026
Merged

mark9064 merged 4 commits into
InfiniTimeOrg:mainfrom
pipe01:fix-date-log

Conversation

@pipe01

@pipe01 pipe01 commented Dec 29, 2025

Copy link
Copy Markdown
Contributor

The SetTime method is indirectly called by the global variable constructor in main.cpp, which runs before the logger is initialized and thus crashes when trying to log a message. This doesn't affect release builds since logging is disabled there, but it does affect debug builds

@github-actions

github-actions Bot commented Dec 29, 2025 •

Copy link
Copy Markdown

Build size and comparison to main:

Section Size Difference
text 393232B 0B
data 936B 0B
bss 22920B 0B

Run in InfiniEmu

@mark9064 mark9064 added the bug Something isn't working label Dec 30, 2025
@mark9064

Copy link
Copy Markdown
Member

Hmm, I don't really like adding an extra argument to solve this. Could we defer the set time call to after logging is initialised?

@pipe01

pipe01 commented Dec 30, 2025

Copy link
Copy Markdown
Contributor Author

You're right, I think it's better this way

@mark9064 mark9064 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not sure why this method wasn't named correctly to begin with but otherwise all looks good :)

Good idea to move it to Utility as well

Comment thread src/utility/Math.h Resolved
@mark9064

mark9064 commented Nov 2, 2026

Copy link
Copy Markdown
Member

Rebasing for fresh CI run

@mark9064
mark9064 merged commit 9ad1630 into InfiniTimeOrg:main Nov 3, 2026
6 of 7 checks passed
@mark9064

mark9064 commented Nov 3, 2026

Copy link
Copy Markdown
Member

Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants