summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp')
-rw-r--r--BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
index 654daed549..298eb0289b 100644
--- a/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
+++ b/BaseTools/Source/C/VfrCompile/VfrFormPkg.cpp
@@ -787,11 +787,22 @@ CIfrRecordInfoDB::IfrRecordInfoUpdate (
)
{
SIfrRecord *pNode;
+ SIfrRecord *Prev;
if ((pNode = GetRecordInfoFromIdx (RecordIdx)) == NULL) {
return;
}
+ if (LineNo == 0) {
+ //
+ // Line number is not specified explicitly, try to use line number of previous opcode
+ //
+ Prev = GetRecordInfoFromIdx (RecordIdx - 1);
+ if (Prev != NULL) {
+ LineNo = Prev->mLineNo;
+ }
+ }
+
pNode->mLineNo = LineNo;
pNode->mOffset = Offset;
pNode->mBinBufLen = BinBufLen;