diff options
| author | Michael Kubacki <michael.kubacki@microsoft.com> | 2025-05-10 02:44:03 +0300 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2025-11-24 05:18:03 +0300 |
| commit | a3fef3939952ccf387f94b5fb3f1a05f3a015463 (patch) | |
| tree | e3d655557e6fd262827b953f141f4558901f02f5 /MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptInternalFormat.h | |
| parent | 4f323d920f564e1030219becf89ae6d03b7c1d53 (diff) | |
| download | edk2-a3fef3939952ccf387f94b5fb3f1a05f3a015463.tar.xz | |
MdeModulePkg: Fix comparison with wider widths.
https://codeql.github.com/codeql-query-help/cpp/cpp-comparison-with-wider-type
If the narrow type (smaller range) is compared against a wide type
(larger range), the narrow value may overflow before reaching the wide
value. This can cause unexpected behavior, such as:
Infinite loops (loop condition never becomes false).
Incorrect logic (comparison results are misleading).
Why is this casting instead of just changing the type?
Its because the compiler for IA32 will optimize by
inserting a 64bit multiply to dereference into the
array. This will be turned into an unresoled _allmul
that is trying to call into the msvc runtime library,
which doesn't exist.
Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
Co-authored-by: Michael Kubacki <michael.kubacki@microsoft.com>
Co-authored-by: Taylor Beebe <tabeebe@microsoft.com>
Co-authored-by: pohanch <125842322+pohanch@users.noreply.github.com>
Co-authored-by: kenlautner <85201046+kenlautner@users.noreply.github.com>
Co-authored-by: Oliver Smith-Denny <osde@linux.microsoft.com>
Co-authored-by: Sean Brogan <sean.brogan@microsoft.com>
Co-authored-by: Aaron <aaronpop@microsoft>
Diffstat (limited to 'MdeModulePkg/Library/PiDxeS3BootScriptLib/BootScriptInternalFormat.h')
0 files changed, 0 insertions, 0 deletions
