BaseTools/Build: Fix the range expression evaluation error.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: "Bob Feng" <bob.c.feng@intel.com>
Reviewed-by: "Chen, Hesheng" <hesheng.chen@intel.com>
Reviewed-by: "Liu, Yingke D" <yingke.d.liu@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17822 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Bob Feng 2015-07-06 00:55:15 +00:00 committed by bobfeng
parent a5e28cc1d0
commit 0b5203bd84
1 changed files with 14 additions and 14 deletions

View File

@ -263,28 +263,28 @@ class RangeExpression(object):
rangeContainer = RangeContainer() rangeContainer = RangeContainer()
for range1 in rangeContainer1.pop(): for range1 in rangeContainer1.pop():
for range2 in rangeContainer2.pop(): for range2 in rangeContainer2.pop():
if range1.start >= range2.start: start1 = range1.start
start = range1.start end1 = range1.end
end = range1.end start2 = range2.start
range1.start = range2.start end2 = range2.end
range1.end = range2.end if start1 >= start2:
range2.start = start start1, start2 = start2, start1
range2.end = end end1, end2 = end2, end1
if range1.empty: if range1.empty:
rangeid = str(uuid.uuid1()) rangeid = str(uuid.uuid1())
rangeContainer.push(RangeObject(0, 0, True)) rangeContainer.push(RangeObject(0, 0, True))
if range1.end < range2.start: if end1 < start2:
rangeid = str(uuid.uuid1()) rangeid = str(uuid.uuid1())
rangeContainer.push(RangeObject(0, 0, True)) rangeContainer.push(RangeObject(0, 0, True))
elif range1.end == range2.start: elif end1 == start2:
rangeid = str(uuid.uuid1()) rangeid = str(uuid.uuid1())
rangeContainer.push(RangeObject(range1.end, range1.end)) rangeContainer.push(RangeObject(end1, end1))
elif range1.end <= range2.end and range1.end > range2.start: elif end1 <= end2 and end1 > start2:
rangeid = str(uuid.uuid1()) rangeid = str(uuid.uuid1())
rangeContainer.push(RangeObject(range2.start, range1.end)) rangeContainer.push(RangeObject(start2, end1))
elif range1.end >= range2.end: elif end1 >= end2:
rangeid = str(uuid.uuid1()) rangeid = str(uuid.uuid1())
rangeContainer.push(RangeObject(range2.start, range2.end)) rangeContainer.push(RangeObject(start2, end2))
self.operanddict[rangeid] = rangeContainer self.operanddict[rangeid] = rangeContainer
# rangeContainer.dump() # rangeContainer.dump()