From 1b26619087e984211200466612189b2c5c2944e4 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Sat, 27 Nov 2021 11:38:16 -0800 Subject: [PATCH] Fixed method param attribute parsing with no type specified --- IDEHelper/Compiler/BfReducer.cpp | 10 ++++++++++ IDEHelper/Compiler/BfResolvedTypeUtils.cpp | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/IDEHelper/Compiler/BfReducer.cpp b/IDEHelper/Compiler/BfReducer.cpp index f9d9ee12..94e1068f 100644 --- a/IDEHelper/Compiler/BfReducer.cpp +++ b/IDEHelper/Compiler/BfReducer.cpp @@ -9103,6 +9103,16 @@ BfTokenNode* BfReducer::ParseMethodParams(BfAstNode* node, SizedArrayImplAlloc(); + ReplaceNode(attributes, paramDecl); + MoveNode(paramDecl, node); + params->push_back(paramDecl); + MEMBER_SET(paramDecl, mAttributes, attributes); + attributes = NULL; + } + Fail("Invalid token", tokenNode); return NULL; } diff --git a/IDEHelper/Compiler/BfResolvedTypeUtils.cpp b/IDEHelper/Compiler/BfResolvedTypeUtils.cpp index be0de032..4f11d7e6 100644 --- a/IDEHelper/Compiler/BfResolvedTypeUtils.cpp +++ b/IDEHelper/Compiler/BfResolvedTypeUtils.cpp @@ -3474,7 +3474,8 @@ int BfResolvedTypeSet::DoHash(BfTypeReference* typeRef, LookupContext* ctx, BfHa } } - hashVal = ((hashVal ^ (Hash(fieldType, ctx, (BfHashFlags)(BfHashFlag_AllowRef), hashSeed))) << 5) - hashVal; + if (fieldType != NULL) + hashVal = ((hashVal ^ (Hash(fieldType, ctx, (BfHashFlags)(BfHashFlag_AllowRef), hashSeed))) << 5) - hashVal; hashVal = ((hashVal ^ (HashNode(param->mNameNode))) << 5) - hashVal; isFirstParam = true; }