|
From: <qh...@us...> - 2010-08-31 00:40:39
|
Revision: 2031
http://edk2-buildtools.svn.sourceforge.net/edk2-buildtools/?rev=2031&view=rev
Author: qhuang8
Date: 2010-08-31 00:40:33 +0000 (Tue, 31 Aug 2010)
Log Message:
-----------
Enhance build tools to check the maximum size of VOID* typed PCD. If the maximum size is specified but is less than the actual size, build will break instead of adjust the maximum size implicitly.
Modified Paths:
--------------
trunk/BaseTools/Source/Python/AutoGen/GenC.py
Modified: trunk/BaseTools/Source/Python/AutoGen/GenC.py
===================================================================
--- trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-08-30 02:00:29 UTC (rev 2030)
+++ trunk/BaseTools/Source/Python/AutoGen/GenC.py 2010-08-31 00:40:33 UTC (rev 2031)
@@ -1028,7 +1028,9 @@
ArraySize = ArraySize / 2;
if ArraySize < (len(Value) + 1):
- ArraySize = len(Value) + 1
+ EdkLogger.error("build", AUTOGEN_ERROR,
+ "The maximum size of VOID* type PCD '%s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
+ ExtraData="[%s]" % str(Info))
Value = NewValue + '0 }'
Array = '[%d]' % ArraySize
#
@@ -1365,8 +1367,11 @@
Dict['SIZE_TABLE_MAXIMUM_LENGTH'].append(Pcd.MaxDatumSize)
if Pcd.MaxDatumSize != '':
MaxDatumSize = int(Pcd.MaxDatumSize, 0)
- if MaxDatumSize > Size:
- Size = MaxDatumSize
+ if MaxDatumSize < Size:
+ EdkLogger.error("build", AUTOGEN_ERROR,
+ "The maximum size of VOID* type PCD '%s.%s' is less than its actual size occupied." % (Pcd.TokenSpaceGuidCName, Pcd.TokenCName),
+ ExtraData="[%s]" % str(Platform))
+ Size = MaxDatumSize
Dict['STRING_TABLE_LENGTH'].append(Size)
StringTableIndex += 1
StringTableSize += (Size)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|