diff options
author | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-11-30 17:00:19 +0800 |
---|---|---|
committer | Yonghong Zhu <yonghong.zhu@intel.com> | 2016-12-02 11:00:43 +0800 |
commit | 31bf6304ba2dd97585c0170f0040ea48a6973746 (patch) | |
tree | ad3ca0af6094be4af128be5c292ca8b344e728d1 /BaseTools | |
parent | d9077743b67c03061edbb7ce25e29087702694b8 (diff) | |
download | edk2-platforms-31bf6304ba2dd97585c0170f0040ea48a6973746.tar.xz |
BaseTools: add error check for "#image" for idf file format
Add new error check for "#image" keyword used in the image definition
file.
Cc: Liming Gao <liming.gao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools')
-rw-r--r-- | BaseTools/Source/Python/AutoGen/IdfClassObject.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/AutoGen/IdfClassObject.py b/BaseTools/Source/Python/AutoGen/IdfClassObject.py index 76bc6d1b93..d6d4703370 100644 --- a/BaseTools/Source/Python/AutoGen/IdfClassObject.py +++ b/BaseTools/Source/Python/AutoGen/IdfClassObject.py @@ -94,9 +94,12 @@ class IdfFileClassObject(object): if len(Line) == 0:
continue
+ LineNo = GetLineNo(FileIn, Line, False)
+ if not Line.startswith('#image '):
+ EdkLogger.error("Image Definition File Parser", PARSER_ERROR, 'The %s in Line %s of File %s is invalid.' % (Line, LineNo, File.Path))
+
if Line.find('#image ') >= 0:
LineDetails = Line.split()
- LineNo = GetLineNo(FileIn, Line, False)
Len = len(LineDetails)
if Len != 3 and Len != 4:
EdkLogger.error("Image Definition File Parser", PARSER_ERROR, 'The format is not match #image IMAGE_ID [TRANSPARENT] ImageFileName in Line %s of File %s.' % (LineNo, File.Path))
|