From b835114ce214f40ae0279db818ee667ff5d45915 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Mon, 1 Jan 2024 12:48:12 +0100 Subject: [PATCH] Prevent input type assertion --- components/compiler/scanner.hpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/components/compiler/scanner.hpp b/components/compiler/scanner.hpp index d5cea61e7f..34b122413e 100644 --- a/components/compiler/scanner.hpp +++ b/components/compiler/scanner.hpp @@ -70,7 +70,11 @@ namespace Compiler && mData[3] == 0; } - bool isDigit() const { return std::isdigit(mData[0]) && mData[1] == 0 && mData[2] == 0 && mData[3] == 0; } + bool isDigit() const + { + return std::isdigit(static_cast(mData[0])) && mData[1] == 0 && mData[2] == 0 + && mData[3] == 0; + } bool isMinusSign() const { @@ -85,7 +89,8 @@ namespace Compiler if (isMinusSign()) return false; - return std::isalpha(mData[0]) || mData[1] != 0 || mData[2] != 0 || mData[3] != 0; + return std::isalpha(static_cast(mData[0])) || mData[1] != 0 || mData[2] != 0 + || mData[3] != 0; } void appendTo(std::string& str) const