summaryrefslogtreecommitdiffhomepage
path: root/dev/LibCompiler/Frontend.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@nekernel.org>2025-05-23 15:39:40 +0200
committerAmlal El Mahrouss <amlal@nekernel.org>2025-05-23 15:39:58 +0200
commitedcec15a728f2f8e4930dc0565f56a274c3fc0c1 (patch)
treea16f71a0a6bd1f16e25f3866b3c56a3ce7551a26 /dev/LibCompiler/Frontend.h
parent2eed4954c762bb8050e40798c3d9f1d3998324d1 (diff)
bug: figuring out why a segfault occurs after we exit main.
ubsan: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:926:60: runtime error: applying non-zero offset 18446744073709551536 to null pointer SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/v1/vector:926:60 in drv: SIGSEGV: Please report this on the GitHub issues page why? - A bogus iterator gets passed to ::destroy inside the method. next: - Debug that inside lldb. Signed-off-by: Amlal El Mahrouss <amlal@nekernel.org>
Diffstat (limited to 'dev/LibCompiler/Frontend.h')
-rw-r--r--dev/LibCompiler/Frontend.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/dev/LibCompiler/Frontend.h b/dev/LibCompiler/Frontend.h
index 119b9fe..9f6fe71 100644
--- a/dev/LibCompiler/Frontend.h
+++ b/dev/LibCompiler/Frontend.h
@@ -81,22 +81,22 @@ enum KeywordKind {
/// \brief Compiler keyword information struct.
struct CompilerKeyword {
- std::string keyword_name;
- KeywordKind keyword_kind = kKeywordKindInvalid;
+ std::string keyword_name{""};
+ KeywordKind keyword_kind{kKeywordKindInvalid};
};
+
struct SyntaxLeafList final {
struct SyntaxLeaf final {
Int32 fUserType;
+
#ifdef LC_USE_STRUCTS
CompilerKeyword fUserData;
#else
std::string fUserData;
#endif
- SyntaxLeaf() = default;
-
- std::string fUserValue;
- struct SyntaxLeaf* fNext;
+ std::string fUserValue{""};
+ struct SyntaxLeaf* fNext{nullptr};
};
std::vector<SyntaxLeaf> fLeafList;
@@ -111,7 +111,7 @@ struct SyntaxLeafList final {
/// \param haystack base string
/// \param needle the string we search for.
/// \return if we found it or not.
-bool find_word(std::string haystack, std::string needle) noexcept;
+BOOL find_word(std::string haystack, std::string needle) noexcept;
/// find a word within strict conditions and returns a range of it.
/// \param haystack