You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the reference all registers not mentioned as clobbered by a block (by using out("<reg>") _) must have the same (undefined) value they had when entering the block when the asm block ends, "otherwise behavior is undefined".
However, both line 76 and line 85 of enter_unreal_mode in the second stage of the bootloader modify registers without stating this to the compiler.
Because I have never programmed any processor, except microprocessors without differing execution modes, I am unsure if this is actually fine (because upon switching into unreal mode all registers are to be considered clobbered for some reason? But then that would also require marking at least one asm block for the compiler?) or an actual bug which causes UB and should be fixed.
The text was updated successfully, but these errors were encountered:
Thanks a lot for reporting! You're right that this was probably undefined behavior and should have been fixed. Sorry for not reacting earlier!
I think we no longer have this problem with #232 merged, so I think we can close this. Please let me know if you see any similar issue with the current implementation!
According to the reference all registers not mentioned as clobbered by a block (by using
out("<reg>") _
) must have the same (undefined) value they had when entering the block when the asm block ends, "otherwise behavior is undefined".However, both line 76 and line 85 of
enter_unreal_mode
in the second stage of the bootloader modify registers without stating this to the compiler.Because I have never programmed any processor, except microprocessors without differing execution modes, I am unsure if this is actually fine (because upon switching into unreal mode all registers are to be considered clobbered for some reason? But then that would also require marking at least one asm block for the compiler?) or an actual bug which causes UB and should be fixed.
The text was updated successfully, but these errors were encountered: