]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/VfrCompile/VfrSyntax.g
BaseTools/VfrCompile: report error for Integer overflow
[mirror_edk2.git] / BaseTools / Source / C / VfrCompile / VfrSyntax.g
index 84dd2c3ed3fde43087f78f5e07fe3ac7f506f3d0..c72a62ae91241593e73fceaf14950f354fab4829 100644 (file)
@@ -1,7 +1,7 @@
 /*++ @file\r
 Vfr Syntax\r
 \r
-Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -5322,7 +5322,7 @@ EfiVfrParser::_STOU8 (
     }\r
     if((IsHex && ((Value/16) != PreviousValue)) || (!IsHex && ((Value/10) != PreviousValue))) {\r
       sprintf(ErrorMsg, "Overflow: Value %s is too large to store in a UINT8", OrigString);\r
-      gCVfrErrorHandle.HandleWarning (VFR_WARNING_STRING_TO_UINT_OVERFLOW, LineNum, ErrorMsg);\r
+      mParserStatus = mParserStatus + gCVfrErrorHandle.HandleError (VFR_RETURN_STRING_TO_UINT_OVERFLOW, LineNum, ErrorMsg);\r
     }\r
   }\r
 \r
@@ -5359,7 +5359,7 @@ EfiVfrParser::_STOU16 (
     }\r
     if((IsHex && ((Value/16) != PreviousValue)) || (!IsHex && ((Value/10) != PreviousValue))) {\r
       sprintf(ErrorMsg, "Overflow: Value %s is too large to store in a UINT16", OrigString);\r
-      gCVfrErrorHandle.HandleWarning (VFR_WARNING_STRING_TO_UINT_OVERFLOW, LineNum, ErrorMsg);\r
+      mParserStatus = mParserStatus + gCVfrErrorHandle.HandleError (VFR_RETURN_STRING_TO_UINT_OVERFLOW, LineNum, ErrorMsg);\r
     }\r
   }\r
 \r
@@ -5396,7 +5396,7 @@ EfiVfrParser::_STOU32 (
     }\r
     if((IsHex && ((Value/16) != PreviousValue)) || (!IsHex && ((Value/10) != PreviousValue ))) {\r
       sprintf(ErrorMsg, "Overflow: Value %s is too large to store in a UINT32", OrigString);\r
-      gCVfrErrorHandle.HandleWarning (VFR_WARNING_STRING_TO_UINT_OVERFLOW, LineNum, ErrorMsg);\r
+      mParserStatus = mParserStatus + gCVfrErrorHandle.HandleError (VFR_RETURN_STRING_TO_UINT_OVERFLOW, LineNum, ErrorMsg);\r
     }\r
   }\r
 \r
@@ -5432,7 +5432,7 @@ EfiVfrParser::_STOU64 (
     }\r
     if((IsHex && ((Value/16) != PreviousValue)) || ((!IsHex && (Value/10) != PreviousValue))) {\r
       sprintf(ErrorMsg, "Overflow: Value %s is too large to store in a UINT64", OrigString);\r
-      gCVfrErrorHandle.HandleWarning (VFR_WARNING_STRING_TO_UINT_OVERFLOW, LineNum, ErrorMsg);\r
+      mParserStatus = mParserStatus + gCVfrErrorHandle.HandleError (VFR_RETURN_STRING_TO_UINT_OVERFLOW, LineNum, ErrorMsg);\r
     }\r
   }\r
 \r