Fix exception on ARM32 with VS2022 when Print() is invoked

On ARM32 only, it appears that whenever Visual Studio inlines the FloatToString()
call (which it does for Release builds), the resulting executable produces an
"Undefined OpCode Exception" on Print() invocation, regardless of whether there
is an actual float to string conversion occurring there.

To work around this, add an explicit clause to prevent inlining, and do so on all
platform just in case.

Signed-off-by: Pete Batard <pete@akeo.ie>
This commit is contained in:
Pete Batard 2024-05-13 16:42:04 +01:00
parent f2f17bfb16
commit 0c7af72ba8
No known key found for this signature in database
GPG Key ID: 38E0CF5E69EDD671
1 changed files with 5 additions and 0 deletions

View File

@ -1403,6 +1403,11 @@ ValueToString (
*p2 = 0;
}
// Having this call inlined by VS2022 on Release builds produces an
// "Undefined OpCode Exception" on ARM32 whenever Print() is invoked,
// even when no part of the code below is actually being executed...
// For safety, add an explicit clause to prevent inlining on all platforms.
EFI_NOINLINE
VOID
FloatToString (
IN CHAR16 *Buffer,