From 76bf452547c0b6f3941d14739923e07d8be2f4c0 Mon Sep 17 00:00:00 2001 From: calcium Date: Sat, 24 Aug 2024 23:42:43 -0400 Subject: [PATCH] Updated to using std::string from unsigned char* --- src/AttributeParser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/AttributeParser.cpp b/src/AttributeParser.cpp index fc932e6..6b84053 100644 --- a/src/AttributeParser.cpp +++ b/src/AttributeParser.cpp @@ -1,4 +1,4 @@ -#include "ConstantPoolTags/Tags.h" +#include #include #include #include @@ -8,6 +8,7 @@ #include #include #include +#include attribute_info Attributes::AttributesParser(JavaClassFormat& jc) { @@ -28,7 +29,7 @@ attribute_info Attributes::AttributesParser(JavaClassFormat& jc) int idx = ret.info.data()->ToHostFormat(); ASSERT(VEC_ELEM_TYPE(jc.constant_pool[ret.attribute_name_index.ToHostFormat() - 1]) == TYPE(ConstantPoolTags::ConstantUtf8Info)); - std::string str = reinterpret_cast(std::any_cast(jc.constant_pool[ret.attribute_name_index.ToHostFormat() - 1]).bytes); + std::string str = std::any_cast(jc.constant_pool[ret.attribute_name_index.ToHostFormat() - 1]).bytes; switch ((ClassAttributes)crc32_rec(CRC32, str.c_str())) { @@ -39,6 +40,7 @@ attribute_info Attributes::AttributesParser(JavaClassFormat& jc) << std::any_cast(jc.constant_pool[idx - 1]).bytes << std::endl; SOURCE_FILE_Attribute attr; + attr.sourcefile_index = idx; // attr. break; }