summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library/BasePeCoffLib
diff options
context:
space:
mode:
authorandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2011-07-12 03:01:34 +0000
committerandrewfish <andrewfish@6f19259b-4bc3-4df7-8a09-765794883524>2011-07-12 03:01:34 +0000
commitbab427db7d91689247914608b975e629ccb34d7e (patch)
treeca2404c89e0956d8172c165fd31600507ea48950 /MdePkg/Library/BasePeCoffLib
parent271d2c7f99612aae7b487cdad9c391373384e19b (diff)
downloadedk2-bab427db7d91689247914608b975e629ccb34d7e.tar.gz
edk2-bab427db7d91689247914608b975e629ccb34d7e.tar.bz2
edk2-bab427db7d91689247914608b975e629ccb34d7e.zip
MdePkg: Fix X64 clang compile issues.
Fixed issues with X64 clang, and also make StackSwitch push a zero on the new stack to prevent a stack unwind into memory that is no longer valid. signed-off-by: andrewfish reviewed-by: lgao4 reviewed-by: mdkinney git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12007 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdePkg/Library/BasePeCoffLib')
-rw-r--r--MdePkg/Library/BasePeCoffLib/BasePeCoff.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
index 064917cd9b..4bf5b7cbbc 100644
--- a/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
+++ b/MdePkg/Library/BasePeCoffLib/BasePeCoff.c
@@ -829,6 +829,7 @@ PeCoffLoaderLoadImage (
EFI_IMAGE_RESOURCE_DIRECTORY_ENTRY *ResourceDirectoryEntry;
EFI_IMAGE_RESOURCE_DIRECTORY_STRING *ResourceDirectoryString;
EFI_IMAGE_RESOURCE_DATA_ENTRY *ResourceDataEntry;
+ CHAR16 *String;
ASSERT (ImageContext != NULL);
@@ -1209,11 +1210,12 @@ PeCoffLoaderLoadImage (
for (Index = 0; Index < ResourceDirectory->NumberOfNamedEntries; Index++) {
if (ResourceDirectoryEntry->u1.s.NameIsString) {
ResourceDirectoryString = (EFI_IMAGE_RESOURCE_DIRECTORY_STRING *) (Base + ResourceDirectoryEntry->u1.s.NameOffset);
+ String = &ResourceDirectoryString->String[0];
if (ResourceDirectoryString->Length == 3 &&
- ResourceDirectoryString->String[0] == L'H' &&
- ResourceDirectoryString->String[1] == L'I' &&
- ResourceDirectoryString->String[2] == L'I') {
+ String[0] == L'H' &&
+ String[1] == L'I' &&
+ String[2] == L'I') {
//
// Resource Type "HII" found
//