Added unbounded char arrays for null-terminated strings

This commit is contained in:
WerWolv
2021-01-07 21:16:34 +01:00
parent 7e4babaca8
commit 08c802f733
4 changed files with 63 additions and 25 deletions

View File

@@ -192,7 +192,10 @@ namespace hex::lang {
ASTNodeArrayVariableDecl(const ASTNodeArrayVariableDecl &other) : ASTNode(other) {
this->m_name = other.m_name;
this->m_type = other.m_type->clone();
this->m_size = other.m_size->clone();
if (other.m_size != nullptr)
this->m_size = other.m_size->clone();
else
this->m_size = nullptr;
if (other.m_placementOffset != nullptr)
this->m_placementOffset = other.m_placementOffset->clone();

View File

@@ -28,6 +28,9 @@ namespace hex::lang {
result += *c;
}
if (*(data + size - 1) == '\x00')
result.pop_back();
return result;
}